officefileapi-devexpress-dot-spreadsheet-dot-shape-5b01e466.md
Saves the drawing object as an image.
Namespace : DevExpress.Spreadsheet
Assembly : DevExpress.Spreadsheet.v25.2.Core.dll
NuGet Package : DevExpress.Spreadsheet.Core
OfficeImage ExportToImage()
Function ExportToImage As OfficeImage
| Type | Description |
|---|---|
| OfficeImage |
The resulting image.
|
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().NativeImage.Save("MyTextBox.png");
Dim textBox As Shape = worksheet.Shapes.AddTextBox(50, 120, 500, 250, "Spreadsheet")
textBox.Fill.SetSolidFill(Color.PowderBlue)
textBox.ExportToImage().NativeImage.Save("MyTextBox.png")
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the ExportToImage() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
office-file-api-ai-implementation/CS/Controllers/AccessibilityController.cs#L74
{
OfficeImage image = chart.ExportToImage();
string description = await imageHelper.DescribeImageAsync(image);
See Also