Class ImageSaveOptions

Class ImageSaveOptions

Namespace: Aspose.Words.Saving
Assembly: Aspose.Words.dll (25.3.0)

Allows to specify additional options when rendering document pages or shapes to images.

To learn more, visit the Specify Save Options documentation article.

public class ImageSaveOptions : FixedPageSaveOptions

Inheritance

objectSaveOptionsFixedPageSaveOptionsImageSaveOptions

Inherited Members

FixedPageSaveOptions.Equals(object), FixedPageSaveOptions.AssertValidIdPrefix(string), FixedPageSaveOptions.IsValidIdPrefix(string), FixedPageSaveOptions.PageSet, FixedPageSaveOptions.PageSavingCallback, FixedPageSaveOptions.NumeralFormat, FixedPageSaveOptions.MetafileRenderingOptions, FixedPageSaveOptions.JpegQuality, FixedPageSaveOptions.ColorMode, FixedPageSaveOptions.OptimizeOutput, SaveOptions.CreateSaveOptions(SaveFormat), SaveOptions.CreateSaveOptions(string), SaveOptions.SaveFormat, SaveOptions.ExportGeneratorName, SaveOptions.TempFolder, SaveOptions.PrettyFormat, SaveOptions.UseAntiAliasing, SaveOptions.UseHighQualityRendering, SaveOptions.DmlRenderingMode, SaveOptions.DmlEffectsRenderingMode, SaveOptions.ImlRenderingMode, SaveOptions.DefaultTemplate, SaveOptions.UpdateFields, SaveOptions.UpdateLastSavedTimeProperty, SaveOptions.UpdateLastPrintedProperty, SaveOptions.UpdateCreatedTimeProperty, SaveOptions.MemoryOptimization, SaveOptions.UpdateAmbiguousTextFont, SaveOptions.Dml3DEffectsRenderingMode, SaveOptions.ProgressCallback, SaveOptions.AllowEmbeddingPostScriptFonts, SaveOptions.CustomTimeZoneInfo, object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

ImageSaveOptions(SaveFormat)

Initializes a new instance of this class that can be used to save rendered images in the Aspose.Words.SaveFormat.Tiff, Aspose.Words.SaveFormat.Png, Aspose.Words.SaveFormat.Bmp, Aspose.Words.SaveFormat.Jpeg, Aspose.Words.SaveFormat.Emf, Aspose.Words.SaveFormat.Eps, Aspose.Words.SaveFormat.WebP or Aspose.Words.SaveFormat.Svg format.

public ImageSaveOptions(SaveFormat saveFormat)

Parameters

saveFormat SaveFormat

Can be Aspose.Words.SaveFormat.Tiff, Aspose.Words.SaveFormat.Png, Aspose.Words.SaveFormat.Bmp, Aspose.Words.SaveFormat.Jpeg, Aspose.Words.SaveFormat.Emf, Aspose.Words.SaveFormat.EpsAspose.Words.SaveFormat.WebP or Aspose.Words.SaveFormat.Svg format.

Properties

HorizontalResolution

Gets or sets the horizontal resolution for the generated images, in dots per inch.

public float HorizontalResolution { get; set; }

Property Value

float

Remarks

This property has effect only when saving to raster image formats and affects the output size in pixels.

The default value is 96.

ImageBrightness

Gets or sets the brightness for the generated images.

public float ImageBrightness { get; set; }

Property Value

float

Remarks

This property has effect only when saving to raster image formats.

The default value is 0.5. The value must be in the range between 0 and 1.

ImageColorMode

Gets or sets the color mode for the generated images.

public ImageColorMode ImageColorMode { get; set; }

Property Value

ImageColorMode

Remarks

This property has effect only when saving to raster image formats.

The default value is Aspose.Words.Saving.ImageColorMode.None.

ImageContrast

Gets or sets the contrast for the generated images.

public float ImageContrast { get; set; }

Property Value

float

Remarks

This property has effect only when saving to raster image formats.

The default value is 0.5. The value must be in the range between 0 and 1.

ImageSize

Gets or sets the size of a generated image in pixels.

public Size ImageSize { get; set; }

Property Value

Size

Remarks

This property has effect only when saving to raster image formats.

The default value is (0 x 0), which means that the size of the generated image will be calculated according to the size of the image in points, the specified resolution and scale.

JpegQuality

Gets or sets a value determining the quality of the generated JPEG images.

public int JpegQuality { get; set; }

Property Value

int

Remarks

Has effect only when saving to JPEG.

Use this property to get or set the quality of generated images when saving in JPEG format. The value may vary from 0 to 100 where 0 means worst quality but maximum compression and 100 means best quality but minimum compression.

The default value is 95.

MetafileRenderingOptions

Allows to specify how metafiles are treated in the rendered output.

public MetafileRenderingOptions MetafileRenderingOptions { get; }

Property Value

MetafileRenderingOptions

Remarks

When Aspose.Words.Saving.MetafileRenderingMode.Vector is specified, Aspose.Words renders metafile to vector graphics using its own metafile rendering engine first and then renders vector graphics to the image.

When Aspose.Words.Saving.MetafileRenderingMode.Bitmap is specified, Aspose.Words renders metafile directly to the image using the GDI+ metafile rendering engine.

GDI+ metafile rendering engine works faster, supports almost all metafile features but on low resolutions may produce inconsistent result when compared to the rest of vector graphics (especially for text) on the page. Aspose.Words metafile rendering engine will produce more consistent result even on low resolutions but works slower and may inaccurately render complex metafiles.

The default value for Aspose.Words.Saving.MetafileRenderingMode is Aspose.Words.Saving.MetafileRenderingMode.Bitmap.

PageSet

Gets or sets the pages to render. Default is all the pages in the document.

public PageSet PageSet { get; set; }

Property Value

PageSet

Remarks

This property has effect only when rendering document pages. This property is ignored when rendering shapes to images.

PaperColor

Gets or sets the background (paper) color for the generated images.

The default value is System.Drawing.Color.White.

public Color PaperColor { get; set; }

Property Value

Color

Remarks

When rendering pages of a document that specifies its own background color, then the document background color will override the color specified by this property.

PixelFormat

Gets or sets the pixel format for the generated images.

public ImagePixelFormat PixelFormat { get; set; }

Property Value

ImagePixelFormat

Remarks

This property has effect only when saving to raster image formats.

The default value is Aspose.Words.Saving.ImagePixelFormat.Format32BppArgb.

Pixel format of the output image may differ from the set value because of work of GDI+.

Resolution

Sets both horizontal and vertical resolution for the generated images, in dots per inch.

public float Resolution { set; }

Property Value

float

Remarks

This property has effect only when saving to raster image formats.

SaveFormat

Specifies the format in which the rendered document pages or shapes will be saved if this save options object is used. Can be a raster Aspose.Words.SaveFormat.Tiff, Aspose.Words.SaveFormat.Png, Aspose.Words.SaveFormat.Bmp, Aspose.Words.SaveFormat.Jpeg or vector Aspose.Words.SaveFormat.Emf, Aspose.Words.SaveFormat.Eps, Aspose.Words.SaveFormat.WebP, Aspose.Words.SaveFormat.Svg.

public override SaveFormat SaveFormat { get; set; }

Property Value

SaveFormat

Remarks

The number of other options depends on the selected format.

Also, it is possible to save to SVG both via Aspose.Words.Saving.ImageSaveOptions and via Aspose.Words.Saving.SvgSaveOptions.

Scale

Gets or sets the zoom factor for the generated images.

public float Scale { get; set; }

Property Value

float

Remarks

The default value is 1.0. The value must be greater than 0.

ThresholdForFloydSteinbergDithering

Gets or sets the threshold that determines the value of the binarization error in the Floyd-Steinberg method. when Aspose.Words.Saving.ImageBinarizationMethod is Aspose.Words.Saving.ImageBinarizationMethod.FloydSteinbergDithering.

public byte ThresholdForFloydSteinbergDithering { get; set; }

Property Value

byte

Remarks

The default value is 128.

TiffBinarizationMethod

Gets or sets method used while converting images to 1 bpp format when Aspose.Words.Saving.ImageSaveOptions.SaveFormat is Aspose.Words.SaveFormat.Tiff and Aspose.Words.Saving.ImageSaveOptions.TiffCompression is equal to Aspose.Words.Saving.TiffCompression.Ccitt3 or Aspose.Words.Saving.TiffCompression.Ccitt4.

public ImageBinarizationMethod TiffBinarizationMethod { get; set; }

Property Value

ImageBinarizationMethod

Remarks

The default value is Aspose.Words.Saving.ImageBinarizationMethod.Threshold.

TiffCompression

Gets or sets the type of compression to apply when saving generated images to the TIFF format.

public TiffCompression TiffCompression { get; set; }

Property Value

TiffCompression

Remarks

Has effect only when saving to TIFF.

The default value is Aspose.Words.Saving.TiffCompression.Lzw.

UseGdiEmfRenderer

Gets or sets a value determining whether to use GDI+ or Aspose.Words metafile renderer when saving to EMF.

public bool UseGdiEmfRenderer { get; set; }

Property Value

bool

Remarks

If set to true GDI+ metafile renderer is used. I.e. content is written to GDI+ graphics object and saved to metafile.

If set to false Aspose.Words metafile renderer is used. I.e. content is written directly to the metafile format with Aspose.Words.

Has effect only when saving to EMF.

GDI+ saving works only on .NET.

The default value is true.

VerticalResolution

Gets or sets the vertical resolution for the generated images, in dots per inch.

public float VerticalResolution { get; set; }

Property Value

float

Remarks

This property has effect only when saving to raster image formats and affects the output size in pixels.

The default value is 96.

Methods

Clone()

Creates a deep clone of this object.

public ImageSaveOptions Clone()

Returns

ImageSaveOptions

 English