Show / Hide Table of Contents

Class ExcelRangePicture

Pictures in the cell/range

Inheritance
object
ExcelRangePicture
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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

Sets the decorative property (used by accessibility tools)

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

Sets the decorative property (used by accessibility tools)

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

Sets the decorative property (used by accessibility tools)

In this article
Back to top Generated by DocFX