Skip to content

Class ExcelImage

Namespace: OfficeOpenXml.Drawing
Assembly: EPPlus.dll

Represents an image

public class ExcelImage : ExcelImageReadOnly

Inheritance

object ← ExcelImageReadOnly ← ExcelImage

Inherited Members

ExcelImageReadOnly.Bounds
ExcelImageReadOnly.HasImage
ExcelImageReadOnly.ImageBytes
ExcelImageReadOnly.Type
object.Equals(object?, object?)
object.Equals(object?)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object?, object?)
object.ToString()

Constructors

ExcelImage()

Creates an ExcelImage to be used as template for adding images.

public ExcelImage()

ExcelImage(string)

Creates an ExcelImage to be used as template for adding images.

public ExcelImage(string imagePath)

Parameters

imagePath string

A path to the image file to load

ExcelImage(FileInfo)

Creates an ExcelImage to be used as template for adding images.

public ExcelImage(FileInfo imageFile)

Parameters

imageFile FileInfo

A FileInfo referencing the image file to load

ExcelImage(Stream, ePictureType)

Creates an ExcelImage to be used as template for adding images.

public ExcelImage(Stream imageStream, ePictureType pictureType)

Parameters

imageStream Stream

The stream containing the image

pictureType ePictureType

The type of image loaded in the stream

ExcelImage(byte[], ePictureType)

Creates an ExcelImage to be used as template for adding images.

public ExcelImage(byte[] imageBytes, ePictureType pictureType)

Parameters

imageBytes byte[]

The image as a byte array

pictureType ePictureType

The type of image loaded in the stream

Methods

SetImage(string)

Sets a new image.

public void SetImage(string imagePath)

Parameters

imagePath string

The path to the image file.

SetImage(FileInfo)

Sets a new image.

public void SetImage(FileInfo imageFile)

Parameters

imageFile FileInfo

The image file.

SetImage(byte[], ePictureType)

Sets a new image.

public ExcelImage SetImage(byte[] imageBytes, ePictureType pictureType)

Parameters

imageBytes byte[]

The image as a byte array.

pictureType ePictureType

The type of image.

Returns

ExcelImage

SetImage(ExcelImage)

Sets a new image.

public ExcelImage SetImage(ExcelImage image)

Parameters

image ExcelImage

The image object to use.

Returns

ExcelImage

See Also

ExcelImage

SetImage(Stream, ePictureType)

Sets a new image.

public ExcelImage SetImage(Stream imageStream, ePictureType pictureType)

Parameters

imageStream Stream

The stream containing the image.

pictureType ePictureType

The type of image.

Returns

ExcelImage

SetImageAsync(Stream, ePictureType)

Sets a new image.

public Task<ExcelImage> SetImageAsync(Stream imageStream, ePictureType pictureType)

Parameters

imageStream Stream

The stream containing the image.

pictureType ePictureType

The type of image.

Returns

Task<ExcelImage>

SetImageAsync(string)

Sets a new image.

public Task<ExcelImage> SetImageAsync(string imagePath)

Parameters

imagePath string

The path to the image file.

Returns

Task<ExcelImage>

SetImageAsync(FileInfo)

Sets a new image.

public Task<ExcelImage> SetImageAsync(FileInfo imageFile)

Parameters

imageFile FileInfo

The image file.

Returns

Task<ExcelImage>