Skip to content

Class ExcelRangePicture

Namespace: OfficeOpenXml.CellPictures
Assembly: EPPlus.dll

Pictures in the cell/range

public class ExcelRangePicture

Inheritance

object ← ExcelRangePicture

Inherited Members

object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Properties

Exists

Returns true if the range has a picture, otherwise false

public bool Exists { get; }

Property Value

bool

Methods

Get()

Returns a picture of the top-left cell in the range.

public ExcelCellPicture Get()

Returns

ExcelCellPicture

An ExcelCellPicture or null if it doesn't exist

Remove()

Remove any cell picture in the entire range

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

public void Set(byte[] imageBytes, string altText = null, bool isDecorative = false)

Parameters

imageBytes byte[]

byte array of the image file

altText string

Alt text for the cell/range picture

isDecorative bool

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

public void Set(Stream imageStream, string altText = null, bool isDecorative = false)

Parameters

imageStream Stream

Stream containing the image bytes

altText string

Alt text for the cell/range picture

isDecorative bool

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

public void Set(string path, string altText = null, bool isDecorative = false)

Parameters

path string

File path to the image file

altText string

Alt text for the cell/range picture

isDecorative bool

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

public void Set(FileInfo fileInfo, string altText = null, bool isDecorative = false)

Parameters

fileInfo FileInfo

FileInfo representing the path to the image file

altText string

Alt text for the cell/range picture

isDecorative bool

Sets the decorative property (used by accessibility tools)