public abstract class EpsImage extends VectorImage
Base class for EPS format
Convert EPS image to PNG using PostScript rendering.
try (EpsImage image = (EpsImage)Image.load("Sample.eps"))
{
PngOptions options = new PngOptions();
EpsRasterizationOptions epsRasterizationOptions = new EpsRasterizationOptions();
epsRasterizationOptions.setPageWidth(500); // Image width
epsRasterizationOptions.setPageHeight(500); // Image height
epsRasterizationOptions.setPreviewToExport(EpsPreviewFormat.PostScriptRendering); // Render raster image using the PostScript
options.setVectorRasterizationOptions(epsRasterizationOptions);
image.save("Sample.png", options);
}
| Modifier and Type | Method and Description |
|---|---|
void |
cacheData()
Cache can not be used.
|
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
Point |
getBoundingBoxBottomLeft()
Gets the bounding box bottom left position
|
String |
getBoundingBoxString()
Gets the BoundingBox string value
|
Point |
getBoundingBoxTopRight()
Gets the bounding box top right position
|
Date |
getCreationDate()
Gets the CreationDate field
|
String |
getCreationDateString()
Gets he CreationDate field string value
|
String |
getCreator()
Gets the Creator field
|
ImageOptionsBase |
getDefaultOptions(Object[] args)
Gets the default options.
|
abstract int |
getEpsType()
Gets EPS subtype value
|
long |
getFileFormat()
Gets a value of file format
|
int |
getHeight()
Gets the image height.
|
Integer |
getPageNumber()
Gets the page number
|
Integer |
getPagesCount()
Gets the pages count
|
JpegImage |
getPhotoshopThumbnail()
Gets Photoshop preview thumbnail (if it's present in initial EPS data)
|
String |
getPostScriptVersion()
Gets the PostScript version field
|
List<Image> |
getPreviewImages()
Gets the preview images.
|
int |
getPreviewToExport()
Deprecated.
This property move to class EpsRasterizationOptions
|
Size |
getSize()
Gets the image size.
|
String |
getTitle()
Gets the Title field
|
int |
getWidth()
Gets the image width.
|
abstract boolean |
hasRasterPreview()
Gets a value indicating whether this instance has format-specific raster preview
|
boolean |
isCached()
Gets a value indicating whether object's data is cached currently and no data reading is required.
|
void |
resize(int newWidth,
int newHeight,
ImageResizeSettings settings)
Resizes the image.
|
void |
resize(int newWidth,
int newHeight,
int resizeType)
Resizes the image.
|
void |
rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the image.
|
void |
saveData(com.aspose.ms.System.IO.Stream stream)
Saves the data.
|
void |
setPalette(IColorPalette palette,
boolean updateColors)
Sets the image palette.
|
void |
setPreviewToExport(int value)
Deprecated.
This property move to class EpsRasterizationOptions
|
getEmbeddedImages, getHeightF, getSizeF, getWidthFcanLoad, canLoad, canLoad, canLoad, canSave, create, create, create, getBackgroundColor, getBounds, getBufferSizeHint, getContainer, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getInterruptMonitor, getOriginalOptions, getPalette, getProgressEventHandler, getProgressEventHandlerInfo, getProportionalHeight, getProportionalWidth, hasBackgroundColor, isAutoAdjustPalette, isUsePalette, load, load, load, load, load, load, resize, resizeHeightProportionally, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, resizeWidthProportionally, save, save, save, save, save, save, save, save, setAutoAdjustPalette, setBackgroundColor, setBackgroundColor, setBufferSizeHint, setInterruptMonitor, setPalettegetDataStreamContainer, save, save, saveclose, dispose, getDisposedpublic long getFileFormat()
Gets a value of file format
getFileFormat in class ImageFileFormatpublic abstract int getEpsType()
Gets EPS subtype value
public JpegImage getPhotoshopThumbnail()
Gets Photoshop preview thumbnail (if it's present in initial EPS data)
public abstract boolean hasRasterPreview()
Gets a value indicating whether this instance has format-specific raster preview
Value:true if this instance has format-specific raster preview; otherwise, false.public int getBitsPerPixel()
Gets the image bits per pixel count.
Value: The image bits per pixel count.getBitsPerPixel in class Imagepublic int getWidth()
Gets the image width.
Value: The image width.getWidth in interface IObjectWithBoundsgetWidth in class VectorImagepublic int getHeight()
Gets the image height.
Value: The image height.getHeight in interface IObjectWithBoundsgetHeight in class VectorImagepublic Size getSize()
ImageGets the image size.
getSize in interface IObjectWithBoundsgetSize in class Imagepublic boolean isCached()
Gets a value indicating whether object's data is cached currently and no data reading is required.
Value:true if object's data is cached; otherwise, false.isCached in class DataStreamSupporter@Deprecated public final int getPreviewToExport()
Preview to use for export
@Deprecated public final void setPreviewToExport(int value)
Preview to use for export
public String getPostScriptVersion()
Gets the PostScript version field
public String getTitle()
Gets the Title field
public String getCreator()
Gets the Creator field
public String getCreationDateString()
Gets he CreationDate field string value
public Date getCreationDate()
Gets the CreationDate field
public String getBoundingBoxString()
Gets the BoundingBox string value
public Point getBoundingBoxBottomLeft()
Gets the bounding box bottom left position
public Point getBoundingBoxTopRight()
Gets the bounding box top right position
public Integer getPagesCount()
Gets the pages count
public Integer getPageNumber()
Gets the page number
public void cacheData()
Cache can not be used.
cacheData in class DataStreamSupporterpublic void resize(int newWidth,
int newHeight,
int resizeType)
Resizes the image.
resize in class ImagenewWidth - The new width.newHeight - The new height.resizeType - The resize type.Resize EPS image and export it to PNG format.
// Load EPS image
try (Image image = Image.load("AstrixObelix.eps"))
{
// Resize the image using the Mitchell cubic interpolation method
image.resize(400, 400, ResizeType.Mitchell);
// Export image to PNG format
image.save("ExportResult.png", new PngOptions());
}
public void resize(int newWidth,
int newHeight,
ImageResizeSettings settings)
Resizes the image.
resize in class ImagenewWidth - The new width.newHeight - The new height.settings - The resize settings.Resize EPS image using advanced settings.
// Load EPS image
try (Image image = Image.load("AstrixObelix.eps"))
{
ImageResizeSettings resizeSettings = new ImageResizeSettings();
// Set the interpolation mode
resizeSettings.setMode(ResizeType.LanczosResample);
// Set the type of the filter
resizeSettings.setFilterType(ImageFilterType.SmallRectangular);
// Sets the color compare method
resizeSettings.setColorCompareMethod(ColorCompareMethod.Euclidian);
// Set the color quantization method
resizeSettings.setColorQuantizationMethod(ColorQuantizationMethod.Popularity);
// Resize the image using advanced resize settings
image.resize(400, 400, resizeSettings);
// Export image to PNG format
image.save("ExportResult.png", new PngOptions());
}
public void rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the image.
rotateFlip in class ImagerotateFlipType - Type of the rotates flip.com.aspose.ms.System.NotSupportedException - Rotate flip is not supported for EPS imagepublic void setPalette(IColorPalette palette, boolean updateColors)
Sets the image palette.
setPalette in class Imagepalette - The palette to set.updateColors - if set to true colors will be updated according to the new palette; otherwise color indexes remain unchanged. Note that unchanged indexes may crash the image on loading if some indexes have no corresponding palette entries.com.aspose.ms.System.NotImplementedException - Not valid for vector imagespublic ImageOptionsBase getDefaultOptions(Object[] args)
Gets the default options.
getDefaultOptions in class Imageargs - The arguments.public List<Image> getPreviewImages()
Gets the preview images.
public void saveData(com.aspose.ms.System.IO.Stream stream)
Saves the data.
stream - The stream to save data to.Copyright (c) 2008-2022 Aspose Pty Ltd. All Rights Reserved.