public class ImageSaveOptions extends FixedPageSaveOptions implements java.lang.Cloneable
To learn more, visit the Specify Save Options documentation article.
| Constructor and Description |
|---|
ImageSaveOptions(int saveFormat)
Initializes a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
ImageSaveOptions |
deepClone()
Creates a deep clone of this object.
|
GraphicsQualityOptions |
getGraphicsQualityOptions()
Allows to specify rendering mode and quality for the
Graphics2D object. |
float |
getHorizontalResolution()
Gets the horizontal resolution for the generated images, in dots per inch.
|
float |
getImageBrightness()
Gets the brightness for the generated images.
|
int |
getImageColorMode()
Gets the color mode for the generated images.
|
float |
getImageContrast()
Gets the contrast for the generated images.
|
int |
getJpegQuality()
Gets a value determining the quality of the generated JPEG images.
|
MetafileRenderingOptions |
getMetafileRenderingOptions()
Allows to specify how metafiles are treated in the rendered output.
|
PageSet |
getPageSet()
Gets the pages to render.
|
java.awt.Color |
getPaperColor()
Gets the background (paper) color for the generated images.
|
int |
getPixelFormat()
Gets the pixel format for the generated images.
|
int |
getSaveFormat()
Specifies the format in which the rendered document pages or shapes will be saved if this save options object is used.
|
float |
getScale()
Gets the zoom factor for the generated images.
|
byte |
getThresholdForFloydSteinbergDithering()
Gets the threshold that determines the value of the binarization error in the Floyd-Steinberg method.
|
int |
getTiffBinarizationMethod()
Gets method used while converting images to 1 bpp format when
getSaveFormat() / setSaveFormat(int) is SaveFormat.Tiff and getTiffCompression() / setTiffCompression(int) is equal to TiffCompression.Ccitt3 or TiffCompression.Ccitt4. |
int |
getTiffCompression()
Gets the type of compression to apply when saving generated images to the TIFF format.
|
boolean |
getUseGdiEmfRenderer()
Gets a value determining whether to use GDI+ or Aspose.Words metafile renderer when saving to EMF.
|
float |
getVerticalResolution()
Gets the vertical resolution for the generated images, in dots per inch.
|
protected java.lang.Object |
memberwiseClone() |
void |
setGraphicsQualityOptions(GraphicsQualityOptions value)
Allows to specify rendering mode and quality for the
Graphics2D object. |
void |
setHorizontalResolution(float value)
Sets the horizontal resolution for the generated images, in dots per inch.
|
void |
setImageBrightness(float value)
Sets the brightness for the generated images.
|
void |
setImageColorMode(int value)
Sets the color mode for the generated images.
|
void |
setImageContrast(float value)
Sets the contrast for the generated images.
|
void |
setJpegQuality(int value)
Sets a value determining the quality of the generated JPEG images.
|
void |
setPageSet(PageSet value)
Sets the pages to render.
|
void |
setPaperColor(java.awt.Color value)
Sets the background (paper) color for the generated images.
|
void |
setPixelFormat(int value)
Sets the pixel format for the generated images.
|
void |
setResolution(float value)
Sets both horizontal and vertical resolution for the generated images, in dots per inch.
|
void |
setSaveFormat(int value)
Specifies the format in which the rendered document pages or shapes will be saved if this save options object is used.
|
void |
setScale(float value)
Sets the zoom factor for the generated images.
|
void |
setThresholdForFloydSteinbergDithering(byte value)
Sets the threshold that determines the value of the binarization error in the Floyd-Steinberg method.
|
void |
setTiffBinarizationMethod(int value)
Sets method used while converting images to 1 bpp format when
getSaveFormat() / setSaveFormat(int) is SaveFormat.Tiff and getTiffCompression() / setTiffCompression(int) is equal to TiffCompression.Ccitt3 or TiffCompression.Ccitt4. |
void |
setTiffCompression(int value)
Sets the type of compression to apply when saving generated images to the TIFF format.
|
void |
setUseGdiEmfRenderer(boolean value)
Sets a value determining whether to use GDI+ or Aspose.Words metafile renderer when saving to EMF.
|
void |
setVerticalResolution(float value)
Sets the vertical resolution for the generated images, in dots per inch.
|
equals, getColorMode, getNumeralFormat, getOptimizeOutput, getPageSavingCallback, setColorMode, setMetafileRenderingOptions, setNumeralFormat, setOptimizeOutput, setPageSavingCallbackcreateSaveOptions, createSaveOptions, getAllowEmbeddingPostScriptFonts, getDefaultTemplate, getDml3DEffectsRenderingMode, getDmlEffectsRenderingMode, getDmlRenderingMode, getExportGeneratorName, getImlRenderingMode, getMemoryOptimization, getPrettyFormat, getProgressCallback, getTempFolder, getUpdateCreatedTimeProperty, getUpdateFields, getUpdateLastPrintedProperty, getUpdateLastSavedTimeProperty, getUpdateSdtContent, getUseAntiAliasing, getUseHighQualityRendering, setAllowEmbeddingPostScriptFonts, setDefaultTemplate, setDml3DEffectsRenderingMode, setDmlEffectsRenderingMode, setDmlRenderingMode, setExportGeneratorName, setImlRenderingMode, setMemoryOptimization, setPrettyFormat, setProgressCallback, setTempFolder, setUpdateCreatedTimeProperty, setUpdateFields, setUpdateLastPrintedProperty, setUpdateLastSavedTimeProperty, setUpdateSdtContent, setUseAntiAliasing, setUseHighQualityRenderingpublic ImageSaveOptions(int saveFormat)
public int getSaveFormat()
SaveFormat.PNG, SaveFormat.BMP, SaveFormat.JPEG or vector SaveFormat.SVG.
On different platforms, the supported formats may be different. The number of other options depends on the selected format.
Also, it is possible to save to SVG both via ImageSaveOptions and via SvgSaveOptions.
getSaveFormat in class SaveOptionsint value. The returned value is one of SaveFormat constants.public void setSaveFormat(int value)
SaveFormat.PNG, SaveFormat.BMP, SaveFormat.JPEG or vector SaveFormat.SVG.
On different platforms, the supported formats may be different. The number of other options depends on the selected format.
Also, it is possible to save to SVG both via ImageSaveOptions and via SvgSaveOptions.
setSaveFormat in class SaveOptionsvalue - The corresponding int value. The value must be one of SaveFormat constants.public PageSet getPageSet()
This property has effect only when rendering document pages. This property is ignored when rendering shapes to images.
getPageSet in class FixedPageSaveOptionspublic void setPageSet(PageSet value)
This property has effect only when rendering document pages. This property is ignored when rendering shapes to images.
setPageSet in class FixedPageSaveOptionsvalue - The pages to render.public java.awt.Color getPaperColor()
The default value is .
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.
public void setPaperColor(java.awt.Color value)
The default value is .
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.
value - The background (paper) color for the generated images.public int getPixelFormat()
This property has effect only when saving to raster image formats.
The default value is ImagePixelFormat.FORMAT_32_BPP_ARGB.
Pixel format of the output image may differ from the set value because of work of GDI+.
ImagePixelFormat constants.public void setPixelFormat(int value)
This property has effect only when saving to raster image formats.
The default value is ImagePixelFormat.FORMAT_32_BPP_ARGB.
Pixel format of the output image may differ from the set value because of work of GDI+.
value - The pixel format for the generated images. The value must be one of ImagePixelFormat constants.public float getHorizontalResolution()
This property has effect only when saving to raster image formats and affects the output size in pixels.
The default value is 96.
public void setHorizontalResolution(float value)
This property has effect only when saving to raster image formats and affects the output size in pixels.
The default value is 96.
value - The horizontal resolution for the generated images, in dots per inch.public float getVerticalResolution()
This property has effect only when saving to raster image formats and affects the output size in pixels.
The default value is 96.
public void setVerticalResolution(float value)
This property has effect only when saving to raster image formats and affects the output size in pixels.
The default value is 96.
value - The vertical resolution for the generated images, in dots per inch.public void setResolution(float value)
This property has effect only when saving to raster image formats.
value - Both horizontal and vertical resolution for the generated images, in dots per inch.public int getJpegQuality()
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.
getJpegQuality in class FixedPageSaveOptionspublic void setJpegQuality(int value)
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.
setJpegQuality in class FixedPageSaveOptionsvalue - A value determining the quality of the generated JPEG images.public int getTiffCompression()
Has effect only when saving to TIFF.
The default value is TiffCompression.CCITT_4.
TiffCompression constants.public void setTiffCompression(int value)
Has effect only when saving to TIFF.
The default value is TiffCompression.CCITT_4.
value - The type of compression to apply when saving generated images to the TIFF format. The value must be one of TiffCompression constants.public int getImageColorMode()
This property has effect only when saving to raster image formats.
The default value is ImageColorMode.NONE.
ImageColorMode constants.public void setImageColorMode(int value)
This property has effect only when saving to raster image formats.
The default value is ImageColorMode.NONE.
value - The color mode for the generated images. The value must be one of ImageColorMode constants.public float getImageBrightness()
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.
public void setImageBrightness(float value)
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.
value - The brightness for the generated images.public float getImageContrast()
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.
public void setImageContrast(float value)
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.
value - The contrast for the generated images.public float getScale()
public void setScale(float value)
value - The zoom factor for the generated images.public MetafileRenderingOptions getMetafileRenderingOptions()
When 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 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 MetafileRenderingMode is MetafileRenderingMode.BITMAP.
getMetafileRenderingOptions in class FixedPageSaveOptionsMetafileRenderingOptions value.public int getTiffBinarizationMethod()
getSaveFormat() / setSaveFormat(int) is SaveFormat.Tiff and getTiffCompression() / setTiffCompression(int) is equal to TiffCompression.Ccitt3 or TiffCompression.Ccitt4.
The default value is ImageBinarizationMethod.Threshold.
getSaveFormat() / setSaveFormat(int) is SaveFormat.Tiff and getTiffCompression() / setTiffCompression(int) is equal to TiffCompression.Ccitt3 or TiffCompression.Ccitt4. The returned value is one of ImageBinarizationMethod constants.public void setTiffBinarizationMethod(int value)
getSaveFormat() / setSaveFormat(int) is SaveFormat.Tiff and getTiffCompression() / setTiffCompression(int) is equal to TiffCompression.Ccitt3 or TiffCompression.Ccitt4.
The default value is ImageBinarizationMethod.Threshold.
value - Method used while converting images to 1 bpp format when getSaveFormat() / setSaveFormat(int) is SaveFormat.Tiff and getTiffCompression() / setTiffCompression(int) is equal to TiffCompression.Ccitt3 or TiffCompression.Ccitt4. The value must be one of ImageBinarizationMethod constants.public byte getThresholdForFloydSteinbergDithering()
ImageBinarizationMethod is ImageBinarizationMethod.FloydSteinbergDithering.
The default value is 128.
public void setThresholdForFloydSteinbergDithering(byte value)
ImageBinarizationMethod is ImageBinarizationMethod.FloydSteinbergDithering.
The default value is 128.
value - The threshold that determines the value of the binarization error in the Floyd-Steinberg method.public GraphicsQualityOptions getGraphicsQualityOptions()
Graphics2D object.
Use this property to override the Graphics settings provided by Aspose.Words engine by default.
It will take effect only when a document is being saved to an image-like format.
GraphicsQualityOptions value.public void setGraphicsQualityOptions(GraphicsQualityOptions value)
Graphics2D object.
Use this property to override the Graphics settings provided by Aspose.Words engine by default.
It will take effect only when a document is being saved to an image-like format.
value - The corresponding GraphicsQualityOptions value.public boolean getUseGdiEmfRenderer()
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.
public void setUseGdiEmfRenderer(boolean value)
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.
value - A value determining whether to use GDI+ or Aspose.Words metafile renderer when saving to EMF.public ImageSaveOptions deepClone()
protected java.lang.Object memberwiseClone()