Skip to main content

ImageInlineDraft Class

Definition​

Assembly:Avalonia.Controls.Documents
Package:Avalonia.Controls.Documents

Inline draft for embedded images. The builder inserts an object replacement character (U+FFFC) for the image, giving the resulting Avalonia.Controls.Documents.Serialization.Snapshot.ImageSnapshotNode a length of one.

public class ImageInlineDraft

Inheritance: object -> InlineDraft -> ImageInlineDraft

Constructors​

NameDescription
ImageInlineDraft (2 overloads)No summary available.

ImageInlineDraft overloads​

ImageInlineDraft Constructor​

public ImageInlineDraft(Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind kind, ReadOnlyMemory<byte> imageData, string imageMimeType, double width, double height, string altText)
Parameters​

kind Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind

imageData ReadOnlyMemory<byte>

imageMimeType string

width double

height double

altText string

ImageInlineDraft Constructor​

public ImageInlineDraft(ReadOnlyMemory<byte> imageData, string imageMimeType, double width, double height, string altText)
Parameters​

imageData ReadOnlyMemory<byte>

imageMimeType string

width double

height double

altText string

Methods​

NameDescription
GetFormatMetadataInherited from InlineDraft.
SetFormatMetadataInherited from InlineDraft.

Properties​

NameDescription
AltTextGets or sets the alternative text describing the image.
CustomDataExtension-specific custom data. Transferred to the resulting Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNode.CustomData during document building. Inherited from InlineDraft.
ElementFormattingBase-level element formatting (font, foreground, background, letter spacing). Inherited from InlineDraft.
FormatMetadataFormat-specific metadata for round-trip preservation (e.g. RTF underline variant). Transferred to the resulting Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNode during document building. Inherited from InlineDraft.
FormattingInline-specific formatting (text decorations, baseline alignment). Inherited from InlineDraft.
HeightGets or sets the display height in device-independent pixels. double.NaN uses the intrinsic pixel size.
ImageDataGets or sets the encoded image bytes.
ImageMimeTypeGets or sets the MIME type of Avalonia.Controls.Documents.Serialization.Authoring.ImageInlineDraft.ImageData.
InlinesGets the mutable list of child inline drafts. Inherited from InlineDraft.
KindGets the Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind that identifies this draft's inline type. Inherited from InlineDraft.
SourceUriThe reference URI for a deferred/linked image (e.g. an image URL), or for an embedded-byte image. When set, Avalonia.Controls.Documents.Serialization.Authoring.ImageInlineDraft.ImageData is typically empty.
WidthGets or sets the display width in device-independent pixels. double.NaN uses the intrinsic pixel size.

AltText Property​

Gets or sets the alternative text describing the image.

public string AltText { get; set; }

Height Property​

Gets or sets the display height in device-independent pixels. double.NaN uses the intrinsic pixel size.

public double Height { get; set; }

ImageData Property​

Gets or sets the encoded image bytes.

public ReadOnlyMemory<byte> ImageData { get; set; }

ImageMimeType Property​

Gets or sets the MIME type of Avalonia.Controls.Documents.Serialization.Authoring.ImageInlineDraft.ImageData.

public string ImageMimeType { get; set; }

SourceUri Property​

The reference URI for a deferred/linked image (e.g. an image URL), or for an embedded-byte image. When set, Avalonia.Controls.Documents.Serialization.Authoring.ImageInlineDraft.ImageData is typically empty.

public string SourceUri { get; set; }

Width Property​

Gets or sets the display width in device-independent pixels. double.NaN uses the intrinsic pixel size.

public double Width { get; set; }