Table of Contents

Class SvgImage

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

Implements methods and properties to work with toolbar svg images. These are rectangular images with small size. This class allows to speed up loading and getting of different states (and sizes) of the same image.

public class SvgImage : NullImageSource, IBaseObject, IImageSource
Inheritance
SvgImage
Implements
Derived

Constructors

SvgImage(Stream, bool)

Initializes a new instance of the SvgImage class.

SvgImage(string, SvgImageDataKind, bool)

Initializes a new instance of the SvgImage class.

Fields

XmlForSvgLoadedWithError

Gets or sets the XML content for an SVG that was loaded with an error.

Properties

IsMono

Gets whether image has single color.

LoadingError

Gets the exception that occurred during the loading process.

NumOfColors

Gets number of colors in svg, passed in the constructor.

Url

Gets image url.

WasLoaded

Gets a value indicating whether the image was loaded.

Xml

Gets the SVG XML content.

Methods

AsDisabled(int, bool)

Gets image with the specified size and Disabled color.

AsDisabledImage(int, bool)

Gets image with the specified size and Disabled color.

AsImage()

Gets svg image as Image with default toolbar image size.

AsImage(int)

Gets svg image as Image.

AsImageSet()

Gets svg image as ImageSet with default toolbar image size.

AsImageSet(int)

Gets svg image as ImageSet.

AsImageSet(int, KnownSvgColor, bool)

Gets image with the specified size and known svg color.

AsNormal(int, bool)

Gets image with the specified size and Normal color.

AsNormalImage(AbstractControl)

Gets the normal image representation for a control using it's scale factor and color theme settings.

AsNormalImage(int, bool)

Gets image with the specified size and Normal color.

Clone()

Clones this object.

GetImageSourceIsEmpty()

Determines whether the image source is empty.

GetImageSourceKind()

Returns the kind of the image source.

GetImageSourceSvgImage()

Returns the SVG image associated with this image source.

GetSvgColor(KnownSvgColor, bool)

Gets real color value for the specified known svg color. Uses GetSvgColor(KnownSvgColor, bool) and color overrides specified with SetColorOverride(KnownSvgColor, bool, Color?).

GetXmlForSvgLoadedWithError()

Gets the XML content for an SVG that was loaded with an error.

ImageSetWithColor(int, Color)

Gets mono svg image as ImageSet filled using the specified color. Svg images with two or more colors are returned as is.

ImageWithColor(int, Color?)

Gets mono svg image as Image filled using the specified color. Svg images with two or more colors are returned as is.

LoadImage()

Loads image if it was not yet loaded from the url or stream specified in the constructor.

LoadImage(SizeI, Color?)

Creates new ImageSet and loads there this svg image with the specified size and color.

LoadImage(int, Color?)

Creates new ImageSet and loads there this svg image with the specified size and color.

ResetCachedImages()

Resets the cached images by clearing the internal data storage.

Resize(int)

Resizes the internal data structure to the specified max image size. This is called automatically when image with the specified size is requested.

SetColorOverride(KnownSvgColor, Color?)

Sets an override for the specified SVG color with the provided value.

SetColorOverride(KnownSvgColor, LightDarkColor?)

Sets color overrides used instead of default known svg colors. Override is used only for this svg image.

SetColorOverride(KnownSvgColor, bool, Color?)

Sets color overrides used instead of default known svg colors. Override is used only for this svg image.

TryGetImage<T>(int, KnownSvgColor, bool, ref object?)

Tries to get svg image as image with pixel data.