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
imageBytesbyte[]The image as a byte array
pictureTypeePictureTypeThe 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
imageFileFileInfoA 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
imageStreamStreamThe stream containing the image
pictureTypeePictureTypeThe 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
imagePathstringA path to the image file to load
Properties
Bounds
The image bounds and resolution
public ExcelImageInfo Bounds { get; }
Property Value
HasImage
If this object contains an image.
public bool HasImage { get; }
Property Value
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
imageExcelImageThe image object to use.
Returns
- See Also
SetImage(byte[], ePictureType)
Sets a new image.
public ExcelImage SetImage(byte[] imageBytes, ePictureType pictureType)
Parameters
imageBytesbyte[]The image as a byte array.
pictureTypeePictureTypeThe type of image.
Returns
SetImage(FileInfo)
Sets a new image.
public void SetImage(FileInfo imageFile)
Parameters
imageFileFileInfoThe image file.
SetImage(Stream, ePictureType)
Sets a new image.
public ExcelImage SetImage(Stream imageStream, ePictureType pictureType)
Parameters
imageStreamStreamThe stream containing the image.
pictureTypeePictureTypeThe type of image.
Returns
SetImage(string)
Sets a new image.
public void SetImage(string imagePath)
Parameters
imagePathstringThe path to the image file.
SetImageAsync(FileInfo)
Sets a new image.
public Task<ExcelImage> SetImageAsync(FileInfo imageFile)
Parameters
imageFileFileInfoThe image file.
Returns
SetImageAsync(Stream, ePictureType)
Sets a new image.
public Task<ExcelImage> SetImageAsync(Stream imageStream, ePictureType pictureType)
Parameters
imageStreamStreamThe stream containing the image.
pictureTypeePictureTypeThe type of image.
Returns
SetImageAsync(string)
Sets a new image.
public Task<ExcelImage> SetImageAsync(string imagePath)
Parameters
imagePathstringThe path to the image file.