RadSvgImage
Represents a control for displaying SVG images in a WPF application. The RadSvgImage class allows for the rendering of SVG files or XML strings as visual content, providing various properties for customization such as UriSource, XmlSource, ImageSource, and options to override colors and stroke widths. It supports animations and custom brushes, enabling the user to tailor the SVG image's appearance to fit specific requirements. The class integrates with the WPF rendering system, ensuring appropriate measurement and layout through dependency properties such as SizeType. Additionally, it handles loading SVG data from various sources, including local files and URI schemes, while maintaining the application’s context through the BaseUri property.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.dll
Syntax:
[TelerikToolboxCategory("Common")]
public class RadSvgImage : Control, IUriContext
Inheritance: objectRadSvgImage
Implements:
Constructors
Initializes a new instance of the RadSvgImage class.
public RadSvgImage()
Fields
CustomBrushesProperty
DependencyProperty
Identifies the CustomBrushes dependency property.
public static readonly DependencyProperty CustomBrushesProperty
ImageSourceProperty
DependencyProperty
Identifies the ImageSource dependency property.
public static readonly DependencyProperty ImageSourceProperty
OverrideColorProperty
DependencyProperty
Identifies the OverrideColor dependency property.
public static readonly DependencyProperty OverrideColorProperty
OverrideStrokeWidthProperty
DependencyProperty
Identifies the OverrideStrokeWidth dependency property.
public static readonly DependencyProperty OverrideStrokeWidthProperty
SizeTypeProperty
DependencyProperty
Identifies the SizeType dependency property.
public static readonly DependencyProperty SizeTypeProperty
UriSourceProperty
DependencyProperty
Identifies the UriSource dependency property.
public static readonly DependencyProperty UriSourceProperty
UseAnimationsProperty
DependencyProperty
Identifies the UseAnimations dependency property.
public static readonly DependencyProperty UseAnimationsProperty
XmlSourceProperty
DependencyProperty
Identifies the XmlSource dependency property.
public static readonly DependencyProperty XmlSourceProperty
Properties
BaseUri
Uri
Gets or sets the base URI of the current application context.
public Uri BaseUri { get; set; }
The base URI of the application context.
CustomBrushes
Dictionary<string, Brush>
Gets or sets the collection of custom brushes.
public Dictionary<string, Brush> CustomBrushes { get; set; }
ImageSource
Drawing
Gets or sets a Drawing that can be used for building the SVG image.
public Drawing ImageSource { get; set; }
OverrideColor
Color?
Gets or sets a value which is used to replace the fill color of this SVG image.
public Color? OverrideColor { get; set; }
Gets or sets a value which is used to replace the stroke width of this SVG image.
public double? OverrideStrokeWidth { get; set; }
UriSource
Uri
Gets or sets the path to the SVG file to load into this image instance.
public Uri UriSource { get; set; }
A Uri specifying the path to the SVG source file. The file can be located on a computer, network or assembly resources.
Gets or sets a value indicating whether the animations are used on this SVG image instance.
public bool UseAnimations { get; set; }
Methods
protected override Size ArrangeOverride(Size arrangeBounds)
Size
protected override Size MeasureOverride(Size constraint)
Size
OnCreateAutomationPeer()
AutomationPeer
Creates a RadSvgImageAutomationPeer.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
protected override void OnRender(DrawingContext drawingContext)
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)