Class
RadSvgImage

Represents a scalable vector graphics (SVG) image that can be rendered at different sizes with high quality.

Definition

Namespace:Telerik.WinControls

Assembly:Telerik.WinControls.dll

Syntax:

cs-api-definition
[TypeConverter(typeof(SvgImageTypeConverter))]
public class RadSvgImage : MarshalByRefObject, ISerializable, ICloneable, IDisposable

Inheritance: objectMarshalByRefObjectRadSvgImage

Implements: ICloneableIDisposableISerializable

Inherited Members MarshalByRefObject.MemberwiseClone(bool)MarshalByRefObject.GetLifetimeService()MarshalByRefObject.InitializeLifetimeService()MarshalByRefObject.CreateObjRef(Type)

Constructors

RadSvgImage(SerializationInfo, StreamingContext)

Declaration

cs-api-definition
protected RadSvgImage(SerializationInfo info, StreamingContext context)

Parameters

info

SerializationInfo

context

StreamingContext

Properties

AllowCache

Gets or sets a value indicating whether to allow caching of the SVG image. When set to true, the image can be cached to improve performance on subsequent loads.

Declaration

cs-api-definition
public static bool AllowCache { get; set; }

Property Value

bool

true if caching is allowed; otherwise, false.

Document

Gets or sets the SVG document associated with this instance.

Declaration

cs-api-definition
[CLSCompliant(false)]
public SvgDocument Document { get; }

Property Value

SvgDocument

Height

Gets or sets the default height of the SVG image. Note that if you set negative value or null, the default height of the SvgDocument will be returned when accessing the property.

Declaration

cs-api-definition
public int Height { get; set; }

Property Value

int

Size

Gets or sets the default size of the SVG image. If this property is not modified it takes the value from the SvgDocument.

Declaration

cs-api-definition
public Size Size { get; set; }

Property Value

Size

Width

Gets or sets the default width of the SVG image. Note that if you set negative value or null, the default width of the SvgDocument will be returned when accessing the property.

Declaration

cs-api-definition
public int Width { get; set; }

Property Value

int

Methods

ClearCache()

Clears all cached raster images.

Declaration

cs-api-definition
public virtual void ClearCache()

Clone()

Creates a new instance of the current RadSvgImage by cloning its properties.

Declaration

cs-api-definition
public object Clone()

Returns

object

A new RadSvgImage object that is a copy of the original instance.

Implements ICloneable.Clone()

Deserialize(string)

Deserializes a string representation of an SVG image into a RadSvgImage object.

Declaration

cs-api-definition
public static RadSvgImage Deserialize(string encodedImage)

Parameters

encodedImage

string

The XML string representation containing the SVG image data to be deserialized.

Returns

RadSvgImage

A RadSvgImage object that represents the deserialized SVG image.

Dispose()

Releases the resources used by the RadSvgImage instance.

Declaration

cs-api-definition
public void Dispose()

Implements IDisposable.Dispose()

Remarks

This method overrides the Dispose method to clean up resources used by the RadSvgImage. It should be called when the object is no longer needed to free up system resources.

FromByteArray(byte[])

Creates a RadSvgImage from the specified byte array.

Declaration

cs-api-definition
public static RadSvgImage FromByteArray(byte[] bytes)

Parameters

bytes

byte[]

A byte array that contains the data for this RadSvgImage.

Returns

RadSvgImage

The RadSvgImage this method creates.

FromFile(string)

Creates a RadSvgImage from the specified file.

Declaration

cs-api-definition
public static RadSvgImage FromFile(string filename)

Parameters

filename

string

A string that contains the name of the file from which to create the RadSvgImage.

Returns

RadSvgImage

The RadSvgImage this method creates.

FromStream(Stream)

Creates a RadSvgImage from the specified data stream.

Declaration

cs-api-definition
public static RadSvgImage FromStream(Stream stream)

Parameters

stream

Stream

A Stream that contains the data for this RadSvgImage.

Returns

RadSvgImage

The RadSvgImage this method creates.

FromXml(string)

Creates a RadSvgImage from the specified XML string.

Declaration

cs-api-definition
public static RadSvgImage FromXml(string xml)

Parameters

xml

string

Returns

RadSvgImage

GetRasterImage(Size, bool)

Returns a raster Bitmap by given size for the loaded SVG document.

Declaration

cs-api-definition
public virtual Bitmap GetRasterImage(Size size, bool cache = true)

Parameters

size

Size

The size of the SVG document.

cache

bool

Determines whether to cache the raster image. Default value is true.

Returns

Bitmap

The raster image.

GetRasterImage(bool)

Returns a raster Bitmap with the default width and height for the loaded SVG document.

Declaration

cs-api-definition
public virtual Bitmap GetRasterImage(bool cache = true)

Parameters

cache

bool

Determines whether to cache the raster image. Default value is true.

Returns

Bitmap

The raster image.

GetRasterImage(int, int, bool)

Returns a raster Bitmap by given width and height for the loaded SVG document.

Declaration

cs-api-definition
public virtual Bitmap GetRasterImage(int width, int height, bool cache = true)

Parameters

width

int

The width of the raster image.

height

int

The height of the raster image.

cache

bool

Determines whether to cache the raster image. Default value is true.

Returns

Bitmap

The raster image.

Serialize(RadSvgImage)

Serializes the specified RadSvgImage into a format suitable for storage or transmission.

Declaration

cs-api-definition
public static string Serialize(RadSvgImage svgImage)

Parameters

svgImage

RadSvgImage

The RadSvgImage instance to be serialized.

Returns

string

A string that represents the serialized form of the provided RadSvgImage.

ToString()

Converts the current instance of the RadSvgImage class to its equivalent string representation.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string that represents the current RadSvgImage object.

Overrides object.ToString()