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
ePictureTypeThe 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
FileInfoA 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
StreamThe stream containing the image
pictureType
ePictureTypeThe 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
stringA 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
image
ExcelImageThe image object to use.
Returns
- 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
ePictureTypeThe type of image.
Returns
SetImage(FileInfo)
Sets a new image.
public void SetImage(FileInfo imageFile)
Parameters
imageFile
FileInfoThe image file.
SetImage(Stream, ePictureType)
Sets a new image.
public ExcelImage SetImage(Stream imageStream, ePictureType pictureType)
Parameters
imageStream
StreamThe stream containing the image.
pictureType
ePictureTypeThe type of image.
Returns
SetImage(string)
Sets a new image.
public void SetImage(string imagePath)
Parameters
imagePath
stringThe path to the image file.
SetImageAsync(FileInfo)
Sets a new image.
public Task<ExcelImage> SetImageAsync(FileInfo imageFile)
Parameters
imageFile
FileInfoThe image file.
Returns
SetImageAsync(Stream, ePictureType)
Sets a new image.
public Task<ExcelImage> SetImageAsync(Stream imageStream, ePictureType pictureType)
Parameters
imageStream
StreamThe stream containing the image.
pictureType
ePictureTypeThe type of image.
Returns
SetImageAsync(string)
Sets a new image.
public Task<ExcelImage> SetImageAsync(string imagePath)
Parameters
imagePath
stringThe path to the image file.