SpreadsheetImageSource.FromFile(String) Method
Creates an image source object from the specified file.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v19.1.Core.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
fileName | String | A string that contains the path to a file from which to create the image. |
Returns
Type | Description |
---|---|
SpreadsheetImageSource | A SpreadsheetImageSource object representing the image in the spreadsheet. |
Remarks
Note
When you use the FromFile method to create an image, the method locks the file until the application is closed. This happens because the method internally creates a file stream intended to load the image from the file, which is not disposed of together with the Workbook/SpreadsheetControl instance and stays alive until you close the application.
If you require releasing the file while the program is running, you can use the SpreadsheetImageSource.FromStream method to create an image and close the stream manually after the image is inserted into the document.