public class CdrImage extends Image implements ICdrImage
The Cdr image.
Image
,
ICdrImage
The following example shows how to cache all pages of a CDR image.
String dir = "c:\\temp\\"; // Load an image from a CDR file. com.aspose.imaging.fileformats.cdr.CdrImage image = (com.aspose.imaging.fileformats.cdr.CdrImage) com.aspose.imaging.Image.load(dir + "sample.cdr"); try { // This call caches only the default page. image.cacheData(); // Cache all pages so that no additional data loading will be performed from the underlying data stream. for (com.aspose.imaging.fileformats.cdr.CdrImagePage page : image.getPages()) { page.cacheData(); } } finally { image.dispose(); }
Constructor and Description |
---|
CdrImage(InputStream stream,
LoadOptions loadOptions)
Initializes a new instance of the
CdrImage class. |
CdrImage(com.aspose.ms.System.IO.Stream stream,
LoadOptions loadOptions) |
Modifier and Type | Method and Description |
---|---|
void |
cacheData()
Caches the data and ensures no additional data loading will be performed from the underlying
DataStreamSupporter.DataStreamContainer (DataStreamSupporter.getDataStreamContainer() /DataStreamSupporter.setDataStreamContainer_internalized(com.aspose.imaging.StreamContainer) ). |
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
CdrDocument |
getCdrDocument()
Gets the CDR document.
|
ImageOptionsBase |
getDefaultOptions(Object[] args)
Gets the default options.
|
long |
getFileFormat()
Gets a value of file format
|
int |
getHeight()
Gets the image height.
|
int |
getPageCount()
Gets the page count.
|
CdrImagePage[] |
getPages()
Gets the pages.
|
int |
getWidth()
Gets the image width.
|
boolean |
isCached()
Gets a value indicating whether object's data is cached currently and no data readig 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 |
setPageCount(int value)
Sets the page count.
|
void |
setPalette(IColorPalette palette,
boolean updateColors)
Sets the image palette.
|
canLoad, canLoad, canLoad, canLoad, canSave, create, getBackgroundColor, getBounds, getBufferSizeHint, getContainer, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getInterruptMonitor, getOriginalOptions, getPalette, getProportionalHeight, getProportionalWidth, getSize, hasBackgroundColor, isAutoAdjustPalette, load, load, load, load, load, load, resize, resizeHeightProportionally, resizeHeightProportionally, resizeHeightProportionally, resizeWidthProportionally, resizeWidthProportionally, resizeWidthProportionally, save, save, save, save, save, save, save, setAutoAdjustPalette, setBackgroundColor, setBackgroundColor, setBufferSizeHint, setInterruptMonitor, setPalette
getDataStreamContainer, save, save, save, save
close, dispose, getDisposed
public CdrImage(InputStream stream, LoadOptions loadOptions)
Initializes a new instance of the CdrImage
class.
stream
- The stream.loadOptions
- The load options.com.aspose.ms.System.IndexOutOfRangeException
- This document not be contained pagespublic CdrImage(com.aspose.ms.System.IO.Stream stream, LoadOptions loadOptions)
public boolean isCached()
Gets a value indicating whether object's data is cached currently and no data readig is required.
isCached
in class DataStreamSupporter
true
if object's data is cached; otherwise, false
.public int getBitsPerPixel()
Gets the image bits per pixel count.
getBitsPerPixel
in class Image
public int getWidth()
Gets the image width.
getWidth
in interface IObjectWithBounds
getWidth
in class Image
public int getHeight()
Gets the image height.
getHeight
in interface IObjectWithBounds
getHeight
in class Image
public final int getPageCount()
Gets the page count.
public final void setPageCount(int value)
Sets the page count.
value
- the page count.public final CdrImagePage[] getPages()
Gets the pages.
public final CdrDocument getCdrDocument()
Gets the CDR document.
getCdrDocument
in interface ICdrImage
public long getFileFormat()
Gets a value of file format
getFileFormat
in class Image
public ImageOptionsBase getDefaultOptions(Object[] args)
Gets the default options.
getDefaultOptions
in class Image
args
- The arguments.public void cacheData()
Caches the data and ensures no additional data loading will be performed from the underlying
DataStreamSupporter.DataStreamContainer
(DataStreamSupporter.getDataStreamContainer()
/DataStreamSupporter.setDataStreamContainer_internalized(com.aspose.imaging.StreamContainer)
).
cacheData
in class DataStreamSupporter
The following example shows how to cache all pages of a CDR image.
String dir = "c:\\temp\\"; // Load an image from a CDR file. com.aspose.imaging.fileformats.cdr.CdrImage image = (com.aspose.imaging.fileformats.cdr.CdrImage) com.aspose.imaging.Image.load(dir + "sample.cdr"); try { // This call caches only the default page. image.cacheData(); // Cache all pages so that no additional data loading will be performed from the underlying data stream. for (com.aspose.imaging.fileformats.cdr.CdrImagePage page : image.getPages()) { page.cacheData(); } } finally { image.dispose(); }
public void resize(int newWidth, int newHeight, int resizeType)
Resizes the image.
public void resize(int newWidth, int newHeight, ImageResizeSettings settings)
Resizes the image.
public void rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the image.
rotateFlip
in class Image
rotateFlipType
- Type of the rotate flip.com.aspose.ms.System.NotImplementedException
- method is not supportedpublic void setPalette(IColorPalette palette, boolean updateColors)
Sets the image palette.
setPalette
in class Image
palette
- 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
- method is not supportedCopyright (c) 2008-2019 Aspose Pty Ltd. All Rights Reserved.