Skip to main content
All docs
V24.2
Row

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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

public class RangeImageOptions

#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:

Spreadsheet - Export a Cell Range to an Image and Set Export Options

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);

#Inheritance

Object
RangeImageOptions
See Also