ColorImage Class

The image of a glyph a font gives as a bitmap: pixels decoded, and scaled to the size the glyph is drawn at, when a text is laid out.

public sealed class ColorImage

Constructors

NameDescription
ColorImage(int, int, byte[])Initializes a new instance of the ColorImage class.

ColorImage(int, int, byte[])

ColorImage.cs

Initializes a new instance of the ColorImage class.

public ColorImage(int width, int height, byte[] pixels)

Parameters

width int
The width of the image, in pixels.
height int
The height of the image, in pixels.
pixels byte[]
The pixels, row by row from the top, four bytes each (red, green, blue, opacity), with colors that are not multiplied by their opacity.

Properties

NameDescription
HeightGets the height of the image, in pixels.
PixelsGets the pixels, row by row from the top, four bytes each (red, green, blue, opacity), with colors that are not multiplied by their opacity.
WidthGets the width of the image, in pixels.

Gets the height of the image, in pixels.

public int Height { get; }

Property value

int

Gets the pixels, row by row from the top, four bytes each (red, green, blue, opacity), with colors that are not multiplied by their opacity.

public ReadOnlySpan<byte> Pixels { get; }

Property value

ReadOnlySpan<byte>

Gets the width of the image, in pixels.

public int Width { get; }

Property value

int