Click or drag to resize
ImageSaveOptions Class
Represents a class which stores saving options for image files.
Inheritance Hierarchy

Namespace: GemBox.Spreadsheet
Assembly: GemBox.Spreadsheet (in GemBox.Spreadsheet.dll) Version: 41.3.30.1000
Syntax
public sealed class ImageSaveOptions : SaveOptions

The ImageSaveOptions type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleImageSaveOptions
Initializes a new instance of the ImageSaveOptions class.
Public methodCode exampleImageSaveOptions(ImageSaveFormat)
Initializes a new instance of the ImageSaveOptions class for a specific image format.
Top
Properties
  NameDescription
Public propertyContentType
Gets the content-type for image file format:
(Overrides SaveOptionsContentType.)
Public propertyDpiX

Gets or sets the horizontal dots per inch (dpi) of the image.

Default value is NaN, which means that component specific default value will be used (currently 300).

Public propertyDpiY

Gets or sets the vertical dots per inch (dpi) of the image.

Default value is NaN, which means that component specific default value will be used (currently 300).

Public propertyFormat
Gets or sets the image format.
Public propertyHeight
Gets or sets the image height in pixels.
Public propertyLimitations
Gets limitations for saving to image file formats.
(Overrides SaveOptionsLimitations.)
Public propertyMetafileScaleFactor
Gets or sets the scaling factor for rendering metafile (WMF and EMF) images. Greater scaling factor improves quality but also increases file size. Default value is 1.
Public propertyPageCount

Gets or sets the number of pages which should be saved to a multi-frame image.

If image format doesn't support multiple frames, this property is ignored.

Default value is 1.

To save all pages, set value to MaxValue.

Only Tagged Image File Format (TIFF) and Graphics Interchange Format (GIF) format images support multiple frames.

Public propertyPageNumber
Gets or sets the zero-based page number of the document's page which should be saved to an image.
Public propertySelectionType
Gets or sets a value indicating whether to save a page from the whole ExcelFile or just ActiveWorksheet.
Public propertyWidth
Gets or sets the image width in pixels.
Top
Examples

Following code demonstrates how to save ExcelFile to image.

// Save first page of the active sheet to .gif image format
ef.Save("Image.gif");

// Save sheet to .jpeg image format. Image will have dimensions: 1024px * 800px
ef.Save("Image.jpeg", new ImageSaveOptions()
{
    Width = 1024,
    Height = 800
});
See Also