Class SvgImageSource

Namespace
Forma
Assembly
Forma.dll

Stores an immutable, preflight-validated SVG source without graphics-device ownership.

public sealed class SvgImageSource : ScalableImageSource, IEquatable<SvgImageSource>
Inheritance
SvgImageSource
Implements
Inherited Members

Properties

ContentIdentity

Gets the stable identity used by scalable-image caches.

public override string ContentIdentity { get; }

Property Value

string

ElementCount

public int ElementCount { get; }

Property Value

int

IntrinsicSize

Gets the source's logical intrinsic size.

public override Vector2 IntrinsicSize { get; }

Property Value

Vector2

LocalReferenceCount

public int LocalReferenceCount { get; }

Property Value

int

PreserveAspectRatio

public string PreserveAspectRatio { get; }

Property Value

string

SourceLength

public int SourceLength { get; }

Property Value

int

ViewBox

public RectangleF? ViewBox { get; }

Property Value

RectangleF?

Methods

Equals(SvgImageSource)

public bool Equals(SvgImageSource other)

Parameters

other SvgImageSource

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

FromFile(string, SvgLoadOptions)

Loads and validates an SVG from a file, copying its bytes into the returned source.

public static SvgImageSource FromFile(string path, SvgLoadOptions options = null)

Parameters

path string
options SvgLoadOptions

Returns

SvgImageSource

FromManifestResource(Assembly, string, SvgLoadOptions)

Loads and validates an SVG from an assembly manifest resource.

public static SvgImageSource FromManifestResource(Assembly assembly, string logicalName, SvgLoadOptions options = null)

Parameters

assembly Assembly
logicalName string
options SvgLoadOptions

Returns

SvgImageSource

FromMemory(ReadOnlyMemory<byte>, SvgLoadOptions)

Copies and validates SVG bytes from caller-owned memory.

public static SvgImageSource FromMemory(ReadOnlyMemory<byte> source, SvgLoadOptions options = null)

Parameters

source ReadOnlyMemory<byte>
options SvgLoadOptions

Returns

SvgImageSource

FromStream(Stream, SvgLoadOptions)

Reads and validates an SVG without taking ownership of the input stream.

public static SvgImageSource FromStream(Stream source, SvgLoadOptions options = null)

Parameters

source Stream
options SvgLoadOptions

Returns

SvgImageSource

GetHashCode()

public override int GetHashCode()

Returns

int

OpenStream()

Opens a read-only stream over a private copy of the validated source.

public Stream OpenStream()

Returns

Stream