ImageSource.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 an ImageSource object and specifies its ImageSource.SvgImage or ImageSource.Image property depending on the image stored in the specified file.
Namespace: DevExpress.XtraPrinting.Drawing
Assembly: DevExpress.Printing.v25.2.Core.dll
NuGet Package: DevExpress.Printing.Core
Declaration
Parameters
| Name | Type | Description |
|---|---|---|
| filename | String | A file name to be used to get an image for the created |
Returns
| Type | Description |
|---|---|
| ImageSource | An |
Remarks
Use this static method to create an ImageSource object for the image that is stored in a specified file. This method detects the image type and saves the image to the corresponding ImageSource.SvgImage or ImageSource.Image property.
using DevExpress.Utils.Svg;
using DevExpress.XtraPrinting.Drawing;
//...
SvgImage myImage = SvgImage.FromFile(@"../../myImage.svg");
ImageSource = ImageSource.FromFile(@"../../myImage.svg")