Show / Hide Table of Contents

# Class Optimizer.ImageSettings

A class that stores downsampling/recompression settings for color and grayscale images.

##### Inheritance

object
Optimizer.ImageSettings

##### Inherited Members

object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()

###### Namespace: pdftron.PDF

###### Assembly: PDFTronDotNet.dll

##### Syntax

    public class Optimizer.ImageSettings

### Constructors

#### ImageSettings()

create an ImageSetting object with default options

##### Declaration

    public ImageSettings()

### Methods

#### ForceChanges(bool)

Sets whether image changes that grow the PDF file should be kept. This is off by default.

##### Declaration

    public void ForceChanges(bool force)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | force | if true all image changes will be kept.

#### ForceRecompression(bool)

Sets whether recompression to the specified compression method should be forced when the image is not downsampled. By default the compression method for these images will not be changed.

##### Declaration

    public void ForceRecompression(bool force)

##### Parameters

Type | Name | Description
--- | --- | ---
bool | force | if true the compression method for all images will be changed to the specified compression mode

#### SetCompressionMode(CompressionMode)

Sets the output compression mode for this type of image The default value is e_retain

##### Declaration

    public void SetCompressionMode(Optimizer.ImageSettings.CompressionMode mode)

##### Parameters

Type | Name | Description
--- | --- | ---
Optimizer.ImageSettings.CompressionMode | mode | the compression mode to set

#### SetDownsampleMode(DownsampleMode)

Sets the downsample mode for this type of image The default value is e_default

##### Declaration

    public void SetDownsampleMode(Optimizer.ImageSettings.DownsampleMode mode)

##### Parameters

Type | Name | Description
--- | --- | ---
Optimizer.ImageSettings.DownsampleMode | mode | the downloadsample mode to set

#### SetImageDPI(double, double)

Sets the maximum and resampling dpi for images. By default these are set to 144 and 96 respectively.

##### Declaration

    public void SetImageDPI(double maximum, double resampling)

##### Parameters

Type | Name | Description
--- | --- | ---
double | maximum | the highest dpi of an image before it will be resampled
double | resampling | resampling the image dpi to resample to if an image is encountered over the maximum dpi

#### SetQuality(uint)

Sets the quality for lossy compression modes from 1 to 10 where 10 is lossless (if possible) the default value is 5

##### Declaration

    public void SetQuality(uint quality)

##### Parameters

Type | Name | Description
--- | --- | ---
uint | quality | compression quality to set