Table of Contents

Class ExcelImage

Namespace
OfficeOpenXml.Drawing
Assembly
EPPlus.dll

Represents an image

public class ExcelImage
Inheritance
ExcelImage
Inherited Members

Constructors

ExcelImage()

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

public ExcelImage()

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

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(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

Properties

Bounds

The image bounds and resolution

public ExcelImageInfo Bounds { get; }

Property Value

ExcelImageInfo

HasImage

If this object contains an image.

public bool HasImage { get; }

Property Value

bool

ImageBytes

The image as a byte array.

public byte[] ImageBytes { get; }

Property Value

byte[]

Type

The type of image.

public ePictureType? Type { get; }

Property Value

ePictureType?

Methods

SetImage(ExcelImage)

Sets a new image.

public ExcelImage SetImage(ExcelImage image)

Parameters

image ExcelImage

The image object to use.

Returns

ExcelImage
See Also

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(FileInfo)

Sets a new image.

public void SetImage(FileInfo imageFile)

Parameters

imageFile FileInfo

The image file.

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

SetImage(string)

Sets a new image.

public void SetImage(string imagePath)

Parameters

imagePath string

The path to the image file.

SetImageAsync(FileInfo)

Sets a new image.

public Task<ExcelImage> SetImageAsync(FileInfo imageFile)

Parameters

imageFile FileInfo

The image file.

Returns

Task<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>