ClassRadSvgImage
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:
[TypeConverter(typeof(SvgImageTypeConverter))]
public class RadSvgImage : MarshalByRefObject, ISerializable, ICloneable, IDisposable
Inheritance: objectMarshalByRefObjectRadSvgImage
Implements:
Inherited Members
Constructors
RadSvgImage(SerializationInfo, StreamingContext)
This constructor is called during the deserialization process. https://docs.microsoft.com/en-us/dotnet/api/system.runtime.serialization.iserializable?view=netframework-2.0
Declaration
protected RadSvgImage(SerializationInfo info, StreamingContext context)
Parameters
info
context
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
public static bool AllowCache { get; set; }
Property Value
true if caching is allowed; otherwise, false.
Document
Gets or sets the SVG document associated with this instance.
Declaration
[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.
Size
Gets or sets the default size of the SVG image. If this property is not modified it takes the value from the SvgDocument.
Methods
ClearCache()
Clears all cached raster images.
Declaration
public virtual void ClearCache()
Clone()
Creates a new instance of the current RadSvgImage by cloning its properties.
Declaration
public object Clone()
Returns
A new RadSvgImage object that is a copy of the original instance.
Implements
Deserialize(string)
Deserializes a string representation of an SVG image into a RadSvgImage object.
Declaration
public static RadSvgImage Deserialize(string encodedImage)
Parameters
encodedImage
The XML string representation containing the SVG image data to be deserialized.
Returns
A RadSvgImage object that represents the deserialized SVG image.
Dispose()
Releases the resources used by the RadSvgImage instance.
Declaration
public void Dispose()
Implements
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
public static RadSvgImage FromByteArray(byte[] bytes)
Parameters
bytes
byte[]
A byte array that contains the data for this RadSvgImage.
Returns
The RadSvgImage this method creates.
FromFile(string)
Creates a RadSvgImage from the specified file.
Declaration
public static RadSvgImage FromFile(string filename)
Parameters
filename
A string that contains the name of the file from which to create the RadSvgImage.
Returns
The RadSvgImage this method creates.
FromStream(Stream)
Creates a RadSvgImage from the specified data stream.
Declaration
public static RadSvgImage FromStream(Stream stream)
Parameters
stream
A Stream that contains the data for this RadSvgImage.
Returns
The RadSvgImage this method creates.
FromXml(string)
Creates a RadSvgImage from the specified XML string.
Declaration
public static RadSvgImage FromXml(string xml)
Parameters
xml
Returns
GetRasterImage(Size, bool)
Returns a raster Bitmap by given size for the loaded SVG document.
GetRasterImage(bool)
Returns a raster Bitmap with the default width and height for the loaded SVG document.
GetRasterImage(int, int, bool)
Returns a raster Bitmap by given width and height for the loaded SVG document.
Declaration
public virtual Bitmap GetRasterImage(int width, int height, bool cache = true)
Parameters
width
The width of the raster image.
height
The height of the raster image.
cache
Determines whether to cache the raster image. Default value is true.
Returns
The raster image.
Serialize(RadSvgImage)
Serializes the specified RadSvgImage into a format suitable for storage or transmission.
Declaration
public static string Serialize(RadSvgImage svgImage)
Parameters
svgImage
The RadSvgImage instance to be serialized.
Returns
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
public override string ToString()
Returns
A string that represents the current RadSvgImage object.
Overrides