Class BitmapExternal
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
public class BitmapExternal : BitmapRef, IDisposable, IBitmap
- Inheritance
-
BitmapExternal
- Implements
- Inherited Members
- Extension Methods
Constructors
BitmapExternal()
public BitmapExternal()
BitmapExternal(byte[], int, ILogger)
Create a BitmapExternal from a byte array
public BitmapExternal(byte[] data, int dataLength, ILogger logger)
Parameters
BitmapExternal(MemoryStream, ILogger, AssetLocation)
public BitmapExternal(MemoryStream ms, ILogger logger, AssetLocation loc = null)
Parameters
ms
MemoryStreamlogger
ILoggerloc
AssetLocation
BitmapExternal(Stream)
public BitmapExternal(Stream stream)
Parameters
stream
Stream
BitmapExternal(int, int)
public BitmapExternal(int width, int height)
Parameters
BitmapExternal(string)
public BitmapExternal(string filePath)
Parameters
filePath
string
Fields
bmp
public SKBitmap bmp
Field Value
Properties
Height
public override int Height { get; }
Property Value
Pixels
public override int[] Pixels { get; }
Property Value
- int[]
PixelsPtrAndLock
public nint PixelsPtrAndLock { get; }
Property Value
Width
public override int Width { get; }
Property Value
Methods
Decode(ReadOnlySpan<byte>)
public static SKBitmap Decode(ReadOnlySpan<byte> buffer)
Parameters
buffer
ReadOnlySpan<byte>
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public override void Dispose()
GetPixel(int, int)
Retrives the ARGB value from given coordinate
public override SKColor GetPixel(int x, int y)
Parameters
Returns
GetPixelRel(float, float)
Retrives the ARGB value from given coordinate using normalized coordinates (0..1)
public override SKColor GetPixelRel(float x, float y)
Parameters
Returns
GetPixelsTransformed(int, int)
public override int[] GetPixelsTransformed(int rot = 0, int mulAlpha = 255)
Parameters
Returns
- int[]
MulAlpha(int)
public override void MulAlpha(int alpha = 255)
Parameters
alpha
int
Save(string)
public override void Save(string filename)
Parameters
filename
string