Table of Contents

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

data byte[]
dataLength int
logger ILogger

BitmapExternal(MemoryStream, ILogger, AssetLocation)

public BitmapExternal(MemoryStream ms, ILogger logger, AssetLocation loc = null)

Parameters

ms MemoryStream
logger ILogger
loc AssetLocation

BitmapExternal(Stream)

public BitmapExternal(Stream stream)

Parameters

stream Stream

BitmapExternal(int, int)

public BitmapExternal(int width, int height)

Parameters

width int
height int

BitmapExternal(string)

public BitmapExternal(string filePath)

Parameters

filePath string

Fields

bmp

public SKBitmap bmp

Field Value

SKBitmap

Properties

Height

public override int Height { get; }

Property Value

int

Pixels

public override int[] Pixels { get; }

Property Value

int[]

PixelsPtrAndLock

public nint PixelsPtrAndLock { get; }

Property Value

nint

Width

public override int Width { get; }

Property Value

int

Methods

Decode(ReadOnlySpan<byte>)

public static SKBitmap Decode(ReadOnlySpan<byte> buffer)

Parameters

buffer ReadOnlySpan<byte>

Returns

SKBitmap

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

x int
y int

Returns

SKColor

GetPixelRel(float, float)

Retrives the ARGB value from given coordinate using normalized coordinates (0..1)

public override SKColor GetPixelRel(float x, float y)

Parameters

x float
y float

Returns

SKColor

GetPixelsTransformed(int, int)

public override int[] GetPixelsTransformed(int rot = 0, int mulAlpha = 255)

Parameters

rot int
mulAlpha int

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