Skip to main content
All docs
V25.1
  • Row

    Shape.ExportToImage(String, ImageFileFormat) Method

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

    Namespace: DevExpress.Spreadsheet

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

    NuGet Package: DevExpress.Spreadsheet.Core

    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