Back to Devexpress

SvgImage.FromFile(String) Method

corelibraries-devexpress-dot-utils-dot-svg-dot-svgimage-dot-fromfile-x28-system-dot-string-x29.md

latest2.7 KB
Original Source

SvgImage.FromFile(String) 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.

Creates a new SvgImage object from a vector image on local storage.

Namespace : DevExpress.Utils.Svg

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public static SvgImage FromFile(
    string path
)
vb
Public Shared Function FromFile(
    path As String
) As SvgImage

Parameters

NameTypeDescription
pathString

A path to the image file.

|

Returns

TypeDescription
SvgImage

The SvgImage object created from the given file.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the FromFile(String) method.

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.

winforms-scheduler-customize-popup-menu/CS/PopupMenuCustomization/Form1.cs#L49

csharp
item.Caption = "&New Meeting";
    item.ImageOptions.SvgImage = DevExpress.Utils.Svg.SvgImage.FromFile("NewItem.svg");
}

winforms-scheduler-customize-popup-menu/VB/PopupMenuCustomization/Form1.vb#L41

vb
item.Caption = "&New Meeting"
    item.ImageOptions.SvgImage = DevExpress.Utils.Svg.SvgImage.FromFile("NewItem.svg")
End If

See Also

SvgImage Class

SvgImage Members

DevExpress.Utils.Svg Namespace