All docs
V21.1
21.2 (EAP/Beta)
21.1
20.2
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
Row

Shape.ExportToImage(String, ImageFileFormat) Method

Saves the drawing object as an image in the specified format.

Namespace: DevExpress.Spreadsheet

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

Declaration

void ExportToImage(
    string fileName,
    ImageFileFormat format
)

Parameters

Name Type Description
fileName String

The file name (including the full path) for the output image.

format ImageFileFormat

The output image format.

Remarks

Use the ExportToImage method to export a drawing object (chart, picture, or shape) as 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("MyTextBox.png", ImageFileFormat.Png);
See Also