Class ExcelImage
Represents an image
Inheritance
Inherited Members
Namespace: OfficeOpenXml.Drawing
Assembly: EPPlus.dll
Syntax
public class ExcelImage
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. |
imageBytes | The image as a byte array |
Office |
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. |
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. |
imageStream | The stream containing the image |
Office |
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. |
imagePath | A path to the image file to load |
Properties
Bounds
The image bounds and resolution
Declaration
public ExcelImageInfo Bounds { get; }
Property Value
Type | Description |
---|---|
Excel |
HasImage
If this object contains an image.
Declaration
public bool HasImage { get; }
Property Value
Type | Description |
---|---|
System. |
ImageBytes
The image as a byte array.
Declaration
public byte[] ImageBytes { get; }
Property Value
Type | Description |
---|---|
System. |
Type
The type of image.
Declaration
public ePictureType? Type { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
SetImage(ExcelImage)
Sets a new image.
Declaration
public ExcelImage SetImage(ExcelImage image)
Parameters
Type | Name | Description |
---|---|---|
Excel |
image | The image object to use. |
Returns
Type | Description |
---|---|
Excel |
See Also
SetImage(Byte[], ePictureType)
Sets a new image.
Declaration
public ExcelImage SetImage(byte[] imageBytes, ePictureType pictureType)
Parameters
Type | Name | Description |
---|---|---|
System. |
imageBytes | The image as a byte array. |
Office |
pictureType | The type of image. |
Returns
Type | Description |
---|---|
Excel |
SetImage(FileInfo)
Sets a new image.
Declaration
public void SetImage(FileInfo imageFile)
Parameters
Type | Name | Description |
---|---|---|
System. |
imageFile | The image file. |
SetImage(Stream, ePictureType)
Sets a new image.
Declaration
public ExcelImage SetImage(Stream imageStream, ePictureType pictureType)
Parameters
Type | Name | Description |
---|---|---|
System. |
imageStream | The stream containing the image. |
Office |
pictureType | The type of image. |
Returns
Type | Description |
---|---|
Excel |
SetImage(String)
Sets a new image.
Declaration
public void SetImage(string imagePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
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. |
imageFile | The image file. |
Returns
Type | Description |
---|---|
System. |
SetImageAsync(Stream, ePictureType)
Sets a new image.
Declaration
public async Task<ExcelImage> SetImageAsync(Stream imageStream, ePictureType pictureType)
Parameters
Type | Name | Description |
---|---|---|
System. |
imageStream | The stream containing the image. |
Office |
pictureType | The type of image. |
Returns
Type | Description |
---|---|
System. |
SetImageAsync(String)
Sets a new image.
Declaration
public async Task<ExcelImage> SetImageAsync(string imagePath)
Parameters
Type | Name | Description |
---|---|---|
System. |
imagePath | The path to the image file. |
Returns
Type | Description |
---|---|
System. |