GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    ImageSaveOptions Class

    Namespace:
    GemBox.Pdf
    Assembly:
    GemBox.Pdf.dll

    Represents a class which stores saving options for image files.

    • C#
    • VB.NET
    public sealed class ImageSaveOptions : SaveOptions
    Public NotInheritable Class ImageSaveOptions
        Inherits SaveOptions
    Inheritance:
    System.Object
    SaveOptions
    ImageSaveOptions

    Constructors

    ImageSaveOptions()

    Initializes a new instance of the ImageSaveOptions class.

    • C#
    • VB.NET
    public ImageSaveOptions()
    Public Sub New

    ImageSaveOptions(ImageSaveFormat)

    Initializes a new instance of the ImageSaveOptions class for a specific image format.

    • C#
    • VB.NET
    public ImageSaveOptions(ImageSaveFormat imageFormat)
    Public Sub New(imageFormat As ImageSaveFormat)
    Parameters
    imageFormat
    ImageSaveFormat

    The image format.

    Properties

    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.

    • C#
    • VB.NET
    public bool Dither { get; set; }
    Public Property Dither As Boolean
    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).

    • C#
    • VB.NET
    public double DpiX { get; set; }
    Public Property DpiX As Double
    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).

    • C#
    • VB.NET
    public double DpiY { get; set; }
    Public Property DpiY As Double
    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.

    • C#
    • VB.NET
    public ImageSaveFormat Format { get; set; }
    Public Property Format As ImageSaveFormat
    Property Value
    ImageSaveFormat

    The image format.

    Height

    Gets or sets the image height in pixels.

    • C#
    • VB.NET
    public double Height { get; set; }
    Public Property Height As Double
    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 slide 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 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 System.Int32.MaxValue.

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

    • C#
    • VB.NET
    public int PageCount { get; set; }
    Public Property PageCount As Integer
    Property Value
    System.Int32

    The number of pages which should be saved to a multi-frame image.

    PageNumber

    Gets or sets the zero-based page number of the document's page which should be saved to an image.

    • C#
    • VB.NET
    public int PageNumber { get; set; }
    Public Property PageNumber As Integer
    Property Value
    System.Int32

    The zero-based page number of the document's page which should be saved to an image.

    PixelFormat

    Gets or sets a pixel format, which will be used for the image.

    • C#
    • VB.NET
    public PixelFormat PixelFormat { get; set; }
    Public Property PixelFormat As PixelFormat
    Property Value
    PixelFormat

    The pixel format, which will be used for the image.

    RotateFlip

    Gets or sets a value indicating whether the image is rotated and/or flipped as specified by the Transform of the PdfImageContent being saved.

    This property is applicable only when saving a PdfImageContent.

    Default value: true.

    • C#
    • VB.NET
    public bool RotateFlip { get; set; }
    Public Property RotateFlip As Boolean
    Property Value
    System.Boolean

    true if the image is rotated and/or flipped as specified by the Transform of the PdfImageContent being saved; otherwise, false.

    TiffCompression

    Gets or sets compression schema, which will be used when exporting to Tagged Image File Format (TIFF).

    • C#
    • VB.NET
    public TiffCompression TiffCompression { get; set; }
    Public Property TiffCompression As TiffCompression
    Property Value
    TiffCompression

    The compression schema, which will be used when exporting to Tagged Image File Format (TIFF).

    Width

    Gets or sets the image width in pixels.

    • C#
    • VB.NET
    public double Width { get; set; }
    Public Property Width As Double
    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 slide 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.

    Inherited Properties

    Image

    Gets the default saving options for image file format. Image will be saved in Bmp format.

    (Inherited from SaveOptions)

    Pdf

    Gets the default saving options for Portable Document Format (PDF).

    (Inherited from SaveOptions)

    Xps

    Gets the default saving options for XML Paper Specification (XPS) format.

    (Inherited from SaveOptions)

    Examples

    Export to ImageSource / Image Control example
    Export Images example
    Convert example

    See Also

    Image
    Save(String, SaveOptions)
    Save(Stream, SaveOptions)
    Save(Stream, ImageSaveOptions)
    Save(String, ImageSaveOptions)
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.