[]
Saves the range to the specified image file.
void ToImage(string imageFile)
Sub ToImage(imageFile As String)
| Type | Name | Description |
|---|---|---|
| string | imageFile | The output image file. |
worksheet.Range["A1"].Value = "Exported";
worksheet.Range["A1:B2"].ToImage("path/to/range.png");
Saves the range to the specified image file using options.
void ToImage(string imageFile, ImageSaveOptions options)
Sub ToImage(imageFile As String, options As ImageSaveOptions)
| Type | Name | Description |
|---|---|---|
| string | imageFile | The output image file. |
| ImageSaveOptions | options | The options for output image. |
worksheet.Range["A1"].Value = "Exported";
ImageSaveOptions options = new ImageSaveOptions();
options.ShowGridlines = true;
worksheet.Range["A1:B2"].ToImage("path/to/range.png", options);
Saves the range to the specified image stream.
void ToImage(Stream stream, ImageType imageType)
Sub ToImage(stream As Stream, imageType As ImageType)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The output image stream. |
| ImageType | imageType | Specifies the type of image to create. |
worksheet.Range["A1"].Value = "Exported";
MemoryStream stream = new MemoryStream();
worksheet.Range["A1:B2"].ToImage(stream, ImageType.PNG);
byte[] imageBytes = stream.ToArray();
Saves the range to the specified image stream using options.
void ToImage(Stream stream, ImageType imageType, ImageSaveOptions options)
Sub ToImage(stream As Stream, imageType As ImageType, options As ImageSaveOptions)
| Type | Name | Description |
|---|---|---|
| Stream | stream | The output image stream. |
| ImageType | imageType | Specifies the type of image to create. |
| ImageSaveOptions | options | The options for output image. |
worksheet.Range["A1"].Value = "Exported";
ImageSaveOptions options = new ImageSaveOptions();
options.ShowGridlines = true;
MemoryStream stream = new MemoryStream();
worksheet.Range["A1:B2"].ToImage(stream, ImageType.PNG, options);
byte[] imageBytes = stream.ToArray();