Back to Devexpress

SvgImageBox.ExportSvgImage(String, SvgImageBoxOptionsExport) Method

windowsforms-devexpress-dot-xtraeditors-dot-svgimagebox-dot-exportsvgimage-x28-system-dot-string-devexpress-dot-xtraeditors-dot-svgimageboxoptionsexport-x29.md

latest4.1 KB
Original Source

SvgImageBox.ExportSvgImage(String, SvgImageBoxOptionsExport) Method

SECURITY-RELATED CONSIDERATIONS

Using file paths sourced from untrusted input may expose unauthorized files or allow unintended file access. Always validate and normalize all external paths to prevent path manipulation.

Saves the current image to the specified file in SVG format.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.Utils.v25.2.dll

NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core

Declaration

csharp
public void ExportSvgImage(
    string path,
    SvgImageBoxOptionsExport exportOptions = null
)
vb
Public Sub ExportSvgImage(
    path As String,
    exportOptions As SvgImageBoxOptionsExport = Nothing
)

Parameters

NameTypeDescription
pathString

The path to the file to which the image is exported.

|

Optional Parameters

NameTypeDefaultDescription
exportOptionsSvgImageBoxOptionsExportnull

An optional object that contains export options.

|

Remarks

The ExportSvgImage method does not save the items’ tags (SvgImageItem.Tag) to the output.

To save item apperance settings (SvgImageBox.ItemAppearance and SvgImageItem.Appearance), use the StoreAppearance property. This property is a combination of bit flags that specify whether to save the appearance settings applied to items in the normal, selected, hovered, and disabled states.

The ExportSvgImage method called without the optional exportOptions parameter takes into account the control’s SvgImageBox.OptionsExport.StoreAppearance setting.

csharp
svgImageBox1.OptionsExport.StoreAppearance = DevExpress.XtraEditors.AppearanceTypes.All;
svgImageBox1.ExportSvgImage("svgimagebox.svg");
vb
SvgImageBox1.OptionsExport.StoreAppearance = DevExpress.XtraEditors.AppearanceTypes.All
SvgImageBox1.ExportSvgImage("svgimagebox.svg")

You can also set the StoreAppearance setting using the ExportSvgImage method’s exportOptions parameter. In this case, the method ignores the control’s SvgImageBox.OptionsExport.StoreAppearance property.

csharp
SvgImageBoxOptionsExport expOptions = new SvgImageBoxOptionsExport();
expOptions.StoreAppearance = AppearanceTypes.Normal | AppearanceTypes.Disabled;
svgImageBox1.ExportSvgImage("svgimagebox.svg", expOptions);
vb
Dim expOptions As SvgImageBoxOptionsExport = New SvgImageBoxOptionsExport()
expOptions.StoreAppearance = AppearanceTypes.Normal Or AppearanceTypes.Disabled
SvgImageBox1.ExportSvgImage("svgimagebox.svg", expOptions)

See Also

StoreAppearance

ItemAppearance

Appearance

SvgImageBox Class

SvgImageBox Members

DevExpress.XtraEditors Namespace