Skip to main content
A newer version of this page is available. .
All docs
V22.1
.NET Framework 4.5.2+
Row

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.v22.1.dll

Declaration

public static OfficeImage ExportToImage(
    this CellRange range
)

Parameters

Name Type Description
range CellRange

The cell range to be exported to an image.

Returns

Type Description
OfficeImage

The output image.

Exceptions

Type Description
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:

Spreadsheet - Export a Cell Range to an Image

using DevExpress.Spreadsheet;
// ...

worksheet.Range["B1:I25"].ExportToImage().NativeImage.Save("RangeImage.png");
See Also