Class ExcelRangePicture
Pictures in the cell/range
Inheritance
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 |
---|---|
System.Boolean |
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, Boolean)
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 |
---|---|---|
System.Byte[] | imageBytes | byte array of the image file |
System.String | altText | Alt text for the cell/range picture |
System.Boolean | isDecorative | Sets the decorative property (used by accessibility tools) |
Set(FileInfo, String, Boolean)
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 |
---|---|---|
System.IO.FileInfo | fileInfo | System.IO.FileInfo representing the path to the image file |
System.String | altText | Alt text for the cell/range picture |
System.Boolean | isDecorative |
|
Set(Stream, String, Boolean)
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 |
---|---|---|
System.IO.Stream | imageStream | System.IO.Stream containing the image bytes |
System.String | altText | Alt text for the cell/range picture |
System.Boolean | isDecorative |
|
Set(String, String, Boolean)
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 |
---|---|---|
System.String | path | File path to the image file |
System.String | altText | Alt text for the cell/range picture |
System.Boolean | isDecorative |
|