JpegXlLayer Class

A layer of a JpegXlLayeredImage: an image of any size, at a position on the canvas, combined with the layers below it with a blend mode, and an optional name.

public sealed class JpegXlLayer

Remarks

The image of the layer belongs to the JpegXlLayeredImage, which disposes it: its pixels may be edited in place. A layer may extend beyond the canvas, where it is cropped when the image is shown.

Properties

NameDescription
BlendModeGets or sets how the layer is combined with the layers below it.
ImageGets the pixels of the layer, owned by the layered image.
NameGets or sets the name of the layer, or null for a layer without name.
OffsetGets or sets the position of the top-left corner of the layer on the canvas; it may be negative.

Gets or sets how the layer is combined with the layers below it.

public JpegXlBlendMode BlendMode { get; set; }

Property value

JpegXlBlendMode

Exceptions

ArgumentOutOfRangeException
The value is not a defined JpegXlBlendMode.

Gets the pixels of the layer, owned by the layered image.

public Image Image { get; }

Property value

Image

Gets or sets the name of the layer, or null for a layer without name.

public string? Name { get; set; }

Property value

string?

Exceptions

ArgumentException
The name has more than JpegXlLayer.MaxNameLength bytes in UTF-8, or is not valid UTF-16 text.

Remarks

An empty name is stored as no name.

Gets or sets the position of the top-left corner of the layer on the canvas; it may be negative.

public Point Offset { get; set; }

Property value

Point

Exceptions

ArgumentOutOfRangeException
A coordinate is below JpegXlLayer.MinOffset or above JpegXlLayer.MaxOffset.

Constants

NameDescription
MaxNameLengthThe largest length of a name, in UTF-8 bytes.
MaxOffsetThe largest offset of a layer, on each axis.
MinOffsetThe smallest offset of a layer, on each axis.

MaxNameLength

The largest length of a name, in UTF-8 bytes.

public const int MaxNameLength = 1071

MaxOffset

The largest offset of a layer, on each axis.

public const int MaxOffset = 536870911

MinOffset

The smallest offset of a layer, on each axis.

public const int MinOffset = -536870912