Class WorkbookMediaExtensions
Provides access to embedded media (images) stored in a workbook's media cache.
Inherited Members
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public static class WorkbookMediaExtensions
Methods
GetEmbeddedImage(Workbook, string)
Gets the embedded image bytes for the specified media file name.
Declaration
public static byte[]? GetEmbeddedImage(this Workbook workbook, string imageFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| Workbook | workbook | The workbook. |
| string | imageFileName | The media file name (e.g. "image1.png"). |
Returns
| Type | Description |
|---|---|
| byte[] | The image bytes, or null if not found. |
GetImageContentType(string)
Gets the content type for an image based on its file extension.
Declaration
public static string GetImageContentType(string imageFileName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | imageFileName | The image file name. |
Returns
| Type | Description |
|---|---|
| string | The MIME content type. |