Back to Devexpress

CellRangeExtensions.ExportToImage(CellRange) Method

officefileapi-devexpress-dot-spreadsheet-dot-cellrangeextensions-dot-exporttoimage-x28-devexpress-dot-spreadsheet-dot-cellrange-x29.md

latest2.4 KB
Original Source

CellRangeExtensions.ExportToImage(CellRange) Method

Exports the cell range to an image.

You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this method in production code.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Docs.v25.2.dll

NuGet Package : DevExpress.Document.Processor

Declaration

csharp
public static OfficeImage ExportToImage(
    this CellRange range
)
vb
<ExtensionAttribute>
Public Shared Function ExportToImage(
    range As CellRange
) As OfficeImage

Parameters

NameTypeDescription
rangeCellRange

The cell range to be exported to an image.

|

Returns

TypeDescription
OfficeImage

The output image.

|

Exceptions

TypeDescription
InvalidOperationException

Occurs when you call this method for a union range that consists of non-adjacent cell ranges.

|

Remarks

The following example demonstrates how to export a cell range to an image:

csharp
using DevExpress.Spreadsheet;
// ...

worksheet.Range["B1:I25"].ExportToImage().NativeImage.Save("RangeImage.png");
vb
Imports DevExpress.Spreadsheet
' ...

worksheet.Range("B1:I25").ExportToImage().NativeImage.Save("RangeImage.png")

See Also

CellRangeExtensions Class

CellRangeExtensions Members

DevExpress.Spreadsheet Namespace