New to Telerik UI for WPFStart a free 30-day trial

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:

C#
[TelerikToolboxCategory("Common")]
public class RadSvgImage : Control, IUriContext

Inheritance: objectRadSvgImage

Implements: IUriContext

Constructors

Initializes a new instance of the RadSvgImage class.

C#
public RadSvgImage()

Fields

CustomBrushesProperty

DependencyProperty

Identifies the CustomBrushes dependency property.

C#
public static readonly DependencyProperty CustomBrushesProperty

ImageSourceProperty

DependencyProperty

Identifies the ImageSource dependency property.

C#
public static readonly DependencyProperty ImageSourceProperty

OverrideColorProperty

DependencyProperty

Identifies the OverrideColor dependency property.

C#
public static readonly DependencyProperty OverrideColorProperty

OverrideStrokeWidthProperty

DependencyProperty

Identifies the OverrideStrokeWidth dependency property.

C#
public static readonly DependencyProperty OverrideStrokeWidthProperty

SizeTypeProperty

DependencyProperty

Identifies the SizeType dependency property.

C#
public static readonly DependencyProperty SizeTypeProperty

UriSourceProperty

DependencyProperty

Identifies the UriSource dependency property.

C#
public static readonly DependencyProperty UriSourceProperty

UseAnimationsProperty

DependencyProperty

Identifies the UseAnimations dependency property.

C#
public static readonly DependencyProperty UseAnimationsProperty

XmlSourceProperty

DependencyProperty

Identifies the XmlSource dependency property.

C#
public static readonly DependencyProperty XmlSourceProperty

Properties

Gets or sets the base URI of the current application context.

C#
public Uri BaseUri { get; set; }
Property Value:

The base URI of the application context.

Gets or sets the collection of custom brushes.

C#
public Dictionary<string, Brush> CustomBrushes { get; set; }

Gets or sets a Drawing that can be used for building the SVG image.

C#
public Drawing ImageSource { get; set; }

Gets or sets a value which is used to replace the fill color of this SVG image.

C#
public Color? OverrideColor { get; set; }

Gets or sets a value which is used to replace the stroke width of this SVG image.

C#
public double? OverrideStrokeWidth { get; set; }

Gets or sets the size type of the image.

C#
public SizeType SizeType { get; set; }

Gets or sets the path to the SVG file to load into this image instance.

C#
public Uri UriSource { get; set; }
Property Value:

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.

C#
public bool UseAnimations { get; set; }

Gets or sets a value which is a XML-based string used as a source for this SVG image instance. This property is set only by the user and is not set internally by the control.

C#
public string XmlSource { get; set; }

Methods

C#
protected override Size ArrangeOverride(Size arrangeBounds)
Parameters:arrangeBoundsSizeReturns:

Size

C#
protected override Size MeasureOverride(Size constraint)
Parameters:constraintSizeReturns:

Size

Creates a RadSvgImageAutomationPeer.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs
C#
protected override void OnRender(DrawingContext drawingContext)
Parameters:drawingContextDrawingContext
C#
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameters:sizeInfoSizeChangedInfo