ImageSaveOptions Class
Represents a class which stores saving options for image files.
public sealed class ImageSaveOptions : SaveOptions
Public NotInheritable Class ImageSaveOptions
Inherits SaveOptions
- Inheritance:
- System.ObjectImageSaveOptions
Remarks
For more information about a level of support for image formats, see supported file formats.
Constructors
ImageSaveOptions()
Initializes a new instance of the ImageSaveOptions class.
ImageSaveOptions(ImageSaveFormat)
Initializes a new instance of the ImageSaveOptions class for a specific image format.
public ImageSaveOptions(ImageSaveFormat imageFormat)
Public Sub New(imageFormat As ImageSaveFormat)
Parameters
imageFormat
- ImageSaveFormat
The image format.
Properties
ContentType
Gets the content-type for image file format:
public override string ContentType { get; }
Public Overrides ReadOnly Property ContentType As String
Property Value
- System.String
The content-type for image file format.
Overrides
Dither
Gets or sets the value that indicated whether dithering should be applied when converting to pixel formats BlackWhite, Gray2, and Gray4.
Default value: true.
This property is currently ignored when RenderingMode is resolved to Skia.
Property Value
- System.Boolean
true if dithering should be applied when converting to pixel formats BlackWhite, Gray2, and Gray4; otherwise, false.
DpiX
Gets or sets the horizontal dots per inch (dpi) of the image.
Default value is System.Double.NaN, which means that component specific default value will be used (currently 300).
Property Value
- System.Double
The horizontal dots per inch (dpi) of the image; that is, the dots per inch (dpi) along the x-axis.
Exceptions
- System.ArgumentOutOfRangeException
Value is not greater than 0.
DpiY
Gets or sets the vertical dots per inch (dpi) of the image.
Default value is System.Double.NaN, which means that component specific default value will be used (currently 300).
Property Value
- System.Double
The vertical dots per inch (dpi) of the image; that is, the dots per inch (dpi) along the y-axis.
Exceptions
- System.ArgumentOutOfRangeException
Value is not greater than 0.
Format
Gets or sets the image format.
Property Value
The image format.
Height
Gets or sets the image height in pixels.
Property Value
- System.Double
The image height in pixels.
Remarks
If both Width and Height are not specified, then image size will be equal to the page size.
If only one of the Width or Height is specified, then the specified dimension will be respected and other dimension will be calculated so that original aspect ratio is maintained.
If both Width and Height are specified, then both specified dimensions will be respected (which may result in non-uniformly scaled image, if aspect ratio is not equal to the original one.
PageCount
Gets or sets the number of pages which should be saved.
Property Value
- System.Int32
The number of pages which should be saved.
Remarks
Only formats that support multiple frames (Tagged Image File Format (TIFF) and Graphics Interchange Format (GIF)) are supported.
If image format doesn't support multiple frames, this property is ignored.
The default value is 1.
PixelFormat
Gets or sets a pixel format, which will be used for the image.
Property Value
The pixel format, which will be used for the image.
RenderingMode
Gets or sets the rendering mode used when saving the content to an image.
public RenderingMode RenderingMode { get; set; }
Public Property RenderingMode As RenderingMode
Property Value
The rendering mode used when saving the content to an image.
Exceptions
- System.NotSupportedException
The rendering mode is not supported because of the reasons explained in the exception's System.Exception.Message.
TiffCompression
Gets or sets compression schema, which will be used when exporting to Tagged Image File Format (TIFF).
public TiffCompression TiffCompression { get; set; }
Public Property TiffCompression As TiffCompression
Property Value
The compression schema, which will be used when exporting to Tagged Image File Format (TIFF).
Width
Gets or sets the image width in pixels.
Property Value
- System.Double
The image width in pixels.
Remarks
If both Width and Height are not specified, then image size will be equal to the page size.
If only one of the Width or Height is specified, then the specified dimension will be respected and other dimension will be calculated so that original aspect ratio is maintained.
If both Width and Height are specified, then both specified dimensions will be respected (which may result in non-uniformly scaled image, if aspect ratio is not equal to the original one.
Events
ProgressChanged
Occurs when saving progress of a document has changed.
public event EventHandler<OperationProgressChangedEventArgs> ProgressChanged
Public Event ProgressChanged As EventHandler(Of OperationProgressChangedEventArgs)
Event Type
- System.EventHandler<OperationProgressChangedEventArgs>
Inherited Properties
DocxDefault | Gets the default saving options for Microsoft Word file format. Word file will be saved in Docx format. (Inherited from SaveOptions) |
HtmlDefault | Gets the default saving options for HyperText Markup Language (HTML) format. (Inherited from SaveOptions) |
ImageDefault | Gets the default saving options for image file format. Image will be saved in Bmp format. (Inherited from SaveOptions) |
OdtDefault | Gets the default saving options for Open Document file format. (Inherited from SaveOptions) |
PageNumber | Gets or sets the zero-based page number of the document's first page which should be saved. (Inherited from SaveOptions) |
PdfDefault | Gets the default saving options for Portable Document Format (PDF). (Inherited from SaveOptions) |
RtfDefault | Gets the default saving options for Rich Text (RTF) format. (Inherited from SaveOptions) |
TxtDefault | Gets the default saving options for Plain Text (TXT) format. (Inherited from SaveOptions) |
XmlDefault | Gets the default saving options for XML file format. (Inherited from SaveOptions) |
XpsDefault | Gets the default saving options for XML Paper Specification (XPS) format. (Inherited from SaveOptions) |