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

Shape.ExportToImage() Method

Exports the drawing object to an image.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v19.1.Core.dll

Declaration

OfficeImage ExportToImage()

Returns

Type Description
OfficeImage

The resulting image.

Remarks

Use the ExportToImage method to export a drawing object (chart, picture, or shape) to an image. This method preserves all display settings applied to the drawing object (for instance, crop, outline, and effects).

The example below shows how to create a text box and save it as an image.

Shape textBox = worksheet.Shapes.AddTextBox(50, 120, 500, 250, "Spreadsheet");
textBox.Fill.SetSolidFill(Color.PowderBlue);
textBox.ExportToImage().NativeImage.Save("MyTextBox.png");
See Also