Show / Hide Table of Contents

Class ExcelImage

Represents an image

Inheritance
System.Object
ExcelImageReadOnly
ExcelImage
Inherited Members
ExcelImageReadOnly.HasImage
ExcelImageReadOnly.Type
ExcelImageReadOnly.ImageBytes
ExcelImageReadOnly.Bounds
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: OfficeOpenXml.Drawing
Assembly: EPPlus.dll
Syntax
public class ExcelImage : ExcelImageReadOnly

Constructors

ExcelImage()

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

Declaration
public ExcelImage()

ExcelImage(Byte[], ePictureType)

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

Declaration
public ExcelImage(byte[] imageBytes, ePictureType pictureType)
Parameters
Type Name Description
System.Byte[] imageBytes

The image as a byte array

OfficeOpenXml.Drawing.ePictureType pictureType

The type of image loaded in the stream

ExcelImage(FileInfo)

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

Declaration
public ExcelImage(FileInfo imageFile)
Parameters
Type Name Description
System.IO.FileInfo imageFile

A FileInfo referencing the image file to load

ExcelImage(Stream, ePictureType)

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

Declaration
public ExcelImage(Stream imageStream, ePictureType pictureType)
Parameters
Type Name Description
System.IO.Stream imageStream

The stream containing the image

OfficeOpenXml.Drawing.ePictureType pictureType

The type of image loaded in the stream

ExcelImage(String)

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

Declaration
public ExcelImage(string imagePath)
Parameters
Type Name Description
System.String imagePath

A path to the image file to load

Methods

SetImage(ExcelImage)

Sets a new image.

Declaration
public ExcelImage SetImage(ExcelImage image)
Parameters
Type Name Description
ExcelImage image

The image object to use.

Returns
Type Description
ExcelImage
See Also
ExcelImage

SetImage(Byte[], ePictureType)

Sets a new image.

Declaration
public ExcelImage SetImage(byte[] imageBytes, ePictureType pictureType)
Parameters
Type Name Description
System.Byte[] imageBytes

The image as a byte array.

OfficeOpenXml.Drawing.ePictureType pictureType

The type of image.

Returns
Type Description
ExcelImage

SetImage(FileInfo)

Sets a new image.

Declaration
public void SetImage(FileInfo imageFile)
Parameters
Type Name Description
System.IO.FileInfo imageFile

The image file.

SetImage(Stream, ePictureType)

Sets a new image.

Declaration
public ExcelImage SetImage(Stream imageStream, ePictureType pictureType)
Parameters
Type Name Description
System.IO.Stream imageStream

The stream containing the image.

OfficeOpenXml.Drawing.ePictureType pictureType

The type of image.

Returns
Type Description
ExcelImage

SetImage(String)

Sets a new image.

Declaration
public void SetImage(string imagePath)
Parameters
Type Name Description
System.String imagePath

The path to the image file.

SetImageAsync(FileInfo)

Sets a new image.

Declaration
public async Task<ExcelImage> SetImageAsync(FileInfo imageFile)
Parameters
Type Name Description
System.IO.FileInfo imageFile

The image file.

Returns
Type Description
System.Threading.Tasks.Task<ExcelImage>

SetImageAsync(Stream, ePictureType)

Sets a new image.

Declaration
public async Task<ExcelImage> SetImageAsync(Stream imageStream, ePictureType pictureType)
Parameters
Type Name Description
System.IO.Stream imageStream

The stream containing the image.

OfficeOpenXml.Drawing.ePictureType pictureType

The type of image.

Returns
Type Description
System.Threading.Tasks.Task<ExcelImage>

SetImageAsync(String)

Sets a new image.

Declaration
public async Task<ExcelImage> SetImageAsync(string imagePath)
Parameters
Type Name Description
System.String imagePath

The path to the image file.

Returns
Type Description
System.Threading.Tasks.Task<ExcelImage>
In This Article
Back to top Generated by DocFX