officefileapi-devexpress-dot-spreadsheet-8723e9f4.md
Contains options used to generate a thumbnail from a worksheet or chart sheet.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
public class SheetThumbnailOptions
Public Class SheetThumbnailOptions
Use the following extension methods to create thumbnail images for worksheets and chart sheets:
WorksheetExtensions.CreateThumbnail—Saves a worksheet as an image. Pass a WorksheetThumbnailOptions object (inherited from SheetThumbnailOptions ) to this method to specify export options.
ChartSheetExtensions.CreateThumbnail—Saves a chart sheet as an image. Pass a SheetThumbnailOptions instance to this method to specify export options.
Important
The WorksheetExtensions and ChartSheetExtensions classes are defined in the DevExpress.Docs.v25.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 code sample below specifies thumbnail options and saves a chart sheet as an image:
using DevExpress.Spreadsheet;
using System.Drawing;
// ...
// Create a new Workbook object.
using (Workbook workbook = new Workbook())
{
// Load a workbook from a file.
workbook.LoadDocument("VariableCosts.xlsx", DocumentFormat.Xlsx);
// Access an active chart sheet.
ChartSheet chartSheet = workbook.ChartSheets.ActiveChartSheet;
// Specify thumbnail options.
var thumbnailOptions = new SheetThumbnailOptions
{
Resolution = 192,
Scale = 40,
BackgroundColor = Color.FromArgb(0xF2, 0xF2, 0xF2)
};
// Save the chart sheet as an image.
chartSheet.CreateThumbnail("Chart_sheet_Thumbnail.png", ImageFileFormat.Png, 800, 600, thumbnailOptions);
}
Imports DevExpress.Spreadsheet
Imports System.Drawing
' ...
' Create a new Workbook object.
Using workbook As New Workbook()
' Load a workbook from a file.
workbook.LoadDocument("VariableCosts.xlsx", DocumentFormat.Xlsx)
' Access an active chart sheet.
Dim chartSheet As ChartSheet = workbook.ChartSheets.ActiveChartSheet
' Specify thumbnail options.
Dim thumbnailOptions = New SheetThumbnailOptions With {
.Resolution = 192,
.Scale = 40,
.BackgroundColor = Color.FromArgb(&HF2, &HF2, &HF2)
}
' Save the chart sheet as an image.
chartSheet.CreateThumbnail("Chart_sheet_Thumbnail.png", ImageFileFormat.Png, 800, 600, thumbnailOptions)
End Using
Object SheetThumbnailOptions WorksheetThumbnailOptions
See Also