SvgImage

SvgImage class

Represents one vector image in SVG (Scalable Vector Graphics) format with its metadata and additional methods

public sealed class SvgImage : VectorImageResourceBase

Constructors

Name Description
SvgImage(string, Stream) Creates new SvgImage instance from content, represented as byte stream, and with specified name
SvgImage(string, string) Creates new SvgImage instance from content, represented as usual string, and with specified name

Properties

Name Description
AspectRatio { get; } Returns aspect ratio of this vector image
override ByteContent { get; } Returns a content of this SVG image as a binary stream
FilenameWithExtension { get; } Returns correct filename of this vector image, which consists of name and extension. Theoretically can differ from the name.
IsDisposed { get; } Determines whether this raster image is disposed (true) or not (false)
LinearDimensions { get; } Returns linear dimensions of this vector image (width and height)
Name { get; } Returns name of this vector image. Usually doesn’t contain filename extension and theoretically can differ from filename.
override TextContent { get; } Returns a content of this SVG image as a base64-encoded binary content (not as a raw text in XML format)
override Type { get; } Returns ImageType.Svg
XmlContent { get; } Returns a content of this SVG image in its original XML-compliant textual form

Methods

Name Description
override Dispose() Disposes this raster image, disposing its content and making most methods and properties non-working
Equals(IHtmlResource) Checks this instance with specified on reference equality.
override Save(string) Saves this SVG image to the file
override SaveToPng(Stream) Saves this vector SVG image into raster PNG image
static IsValid(string) Performs a surface check whether specified textual XML-compliant content represents a SVG image

Events

Name Description
event Disposed Event, which occurs when this raster image is disposed

See Also