Skip to main content
All docs
V26.1
  • Row

    Shape.ExportToImage() Method

    Saves the drawing object as an image.

    Namespace: DevExpress.Spreadsheet

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

    NuGet Package: DevExpress.Spreadsheet.Core

    Declaration

    OfficeImage ExportToImage()

    Returns

    Type Description
    OfficeImage

    The resulting image.

    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().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.

    See Also