SvgImage Class
A vector image.
Namespace: DevExpress.Utils.Svg
Assembly: DevExpress.Data.v22.1.dll
Declaration
public class SvgImage :
ISerializable,
ICloneable
Public Class SvgImage
Implements ISerializable,
ICloneable
Related API Members
The following members return SvgImage objects:
Related API Members
The following members return SvgImage objects:
Related API Members
The following members return SvgImage objects:
Remarks
There are two easy ways to assign DevExpress Vector icons to controls:
- assign them at design time with the Image Picker panel;
- fill the SvgImageCollection with vector icons and assign them to required controls using collection indexers.
If none of these approaches suit your needs, create the SvgImage object manually. To do that, call one of available From… methods.
SvgImage img1 = SvgImage.FromFile("Data\MyImage.svg");
SvgImage img2 = SvgImage.FromResources("MyImage2.svg", typeof(mainForm).Assembly);
Dim img1 As SvgImage = SvgImage.FromFile("Data\MyImage.svg")
Dim img2 As SvgImage = SvgImage.FromResources("MyImage2.svg", GetType(mainForm).Assembly)
Refer to the How To: Draw and Use SVG Images article to learn about vector icon limitations and guidelines.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the SvgImage class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
public ChartScaleBreakModule(DashboardDesigner designer, SvgImage barImage = null) {
this.designer = designer;
editColorsBarItem = new BarButtonItem(designer.Ribbon.Manager, "Edit Colors");
editColorsBarItem.ImageOptions.SvgImage = SvgImage.FromResources("DevExpresss.DashboardWin.CustomItemExtension.Images.Heatmap_ColorScheme.svg", this.GetType().Assembly);
editColorsBarItem.ItemClick += OptionsBarItem_ItemClick;
}
SvgImage GetImage() {
string path = "CustomWizardExample.Wizard.Images.XmlBinding.svg";
BarButtonItem barItem;
public ScatterChartConstantLineUserValueModule(DashboardDesigner designer, SvgImage barImage = null)
{
how-to-customize-the-scheduler-popup-menu-e2554/CS/PopupMenuCustomization/Form1.cs#L49
item.Caption = "&New Meeting";
item.ImageOptions.SvgImage = DevExpress.Utils.Svg.SvgImage.FromFile("NewItem.svg");
}
Public Sub New(ByVal designer As DashboardDesigner, Optional ByVal barImage As SvgImage = Nothing)
Me.designer = designer
editColorsBarItem = New BarButtonItem(designer.Ribbon.Manager, "Edit Colors")
editColorsBarItem.ImageOptions.SvgImage = SvgImage.FromResources("DevExpresss.DashboardWin.CustomItemExtension.Images.Heatmap_ColorScheme.svg", Me.GetType().Assembly)
AddHandler editColorsBarItem.ItemClick, AddressOf OptionsBarItem_ItemClick
Private Function GetImage() As SvgImage
Dim path As String = "XmlBinding.svg"
Private barItem As BarButtonItem
Public Sub New(ByVal designer As DashboardDesigner, Optional ByVal barImage As SvgImage = Nothing)
Me.designer = designer
how-to-customize-the-scheduler-popup-menu-e2554/VB/PopupMenuCustomization/Form1.vb#L47
item.Caption = "&New Meeting"
item.ImageOptions.SvgImage = DevExpress.Utils.Svg.SvgImage.FromFile("NewItem.svg")
End If