Class ExcelRangePicture
Pictures in the cell/range
Inherited Members
Namespace: OfficeOpenXml.CellPictures
Assembly: EPPlus.dll
Syntax
public class ExcelRangePicture
Properties
Exists
Returns true if the range has a picture, otherwise false
Declaration
public bool Exists { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
Get()
Returns a picture of the top-left cell in the range.
Declaration
public ExcelCellPicture Get()
Returns
| Type | Description |
|---|---|
| ExcelCellPicture | An ExcelCellPicture or null if it doesn't exist |
Remove()
Remove any cell picture in the entire range
Declaration
public void Remove()
Set(byte[], string, bool)
Adds (or replaces) a cell picture. EPPlus supports the following image types: Png, Jpg, Gif, Bmp, WebP, Tif, Ico
Declaration
public void Set(byte[] imageBytes, string altText = null, bool isDecorative = false)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | imageBytes | byte array of the image file |
| string | altText | Alt text for the cell/range picture |
| bool | isDecorative | Sets the decorative property (used by accessibility tools) |
Set(FileInfo, string, bool)
Adds (or replaces) a cell picture. EPPlus supports the following image types: Png, Jpg, Gif, Bmp, WebP, Tif, Ico
Declaration
public void Set(FileInfo fileInfo, string altText = null, bool isDecorative = false)
Parameters
| Type | Name | Description |
|---|---|---|
| FileInfo | fileInfo | FileInfo representing the path to the image file |
| string | altText | Alt text for the cell/range picture |
| bool | isDecorative |
|
Set(Stream, string, bool)
Adds (or replaces) a cell picture. EPPlus supports the following image types: Png, Jpg, Gif, Bmp, WebP, Tif, Ico
Declaration
public void Set(Stream imageStream, string altText = null, bool isDecorative = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | imageStream | Stream containing the image bytes |
| string | altText | Alt text for the cell/range picture |
| bool | isDecorative |
|
Set(string, string, bool)
Adds (or replaces) a cell picture. EPPlus supports the following image types: Png, Jpg, Gif, Bmp, WebP, Tif, Ico
Declaration
public void Set(string path, string altText = null, bool isDecorative = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | File path to the image file |
| string | altText | Alt text for the cell/range picture |
| bool | isDecorative |
|