RangeImageOptions Class
Contains options used to export a cell range to an image.
Namespace: DevExpress.Spreadsheet
Assembly: DevExpress.Spreadsheet.v24.2.Core.dll
NuGet Package: DevExpress.Spreadsheet.Core
Declaration
Remarks
Use the CellRangeExtensions.ExportToImage extension method of a CellRange object to save a cell range as an image. Create a RangeImageOptions instance and pass it to this method to specify export options.
Important
The CellRangeExtensions class is defined in the DevExpress.Docs.v24.2.dll assembly. You need a license for the DevExpress Office File API Subscription or DevExpress Universal Subscription to use this assembly in production code.
The following example demonstrates how to export a cell range to an image:
using DevExpress.Spreadsheet;
using System.Drawing;
// ...
var exportOptions = new RangeImageOptions
{
Resolution = 192,
ExportHeadings = true,
ExportGridlines = true,
GridlineColor = Color.Gray,
BackgroundColor = Color.FromArgb(0xF2, 0xF2, 0xF2)
};
worksheet.Range["B1:I25"].ExportToImage("RangeImage.png", ImageFileFormat.Png, exportOptions);