corelibraries-devexpress-dot-utils-dot-svg-dot-svgimage-dot-fromfile-x28-system-dot-string-x29.md
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
public static SvgImage FromFile(
string path
)
Public Shared Function FromFile(
path As String
) As SvgImage
| Name | Type | Description |
|---|---|---|
| path | String |
A path to the image file.
|
| Type | Description |
|---|---|
| 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
item.Caption = "&New Meeting";
item.ImageOptions.SvgImage = DevExpress.Utils.Svg.SvgImage.FromFile("NewItem.svg");
}
winforms-scheduler-customize-popup-menu/VB/PopupMenuCustomization/Form1.vb#L41
item.Caption = "&New Meeting"
item.ImageOptions.SvgImage = DevExpress.Utils.Svg.SvgImage.FromFile("NewItem.svg")
End If
See Also