public class CmxImage extends VectorMultipageImage implements ICmxImage
The CMX image.
Image
The following example shows how to cache all pages of a CMX image.
String dir = "c:\\temp\\"; // Load an image from a CMX file. com.aspose.imaging.fileformats.cmx.CmxImage image = (com.aspose.imaging.fileformats.cmx.CmxImage) com.aspose.imaging.Image.load(dir + "sample.cmx"); 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.cmx.CmxImagePage page : image.getPages()) { page.cacheData(); } } finally { image.dispose(); }
Constructor and Description |
---|
CmxImage(StreamContainer streamContainer,
LoadOptions loadOptions)
Initializes a new instance of the
CmxImage class. |
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(StreamContainer) ). |
int |
getBitsPerPixel()
Gets the image bits per pixel count.
|
CmxPage |
getCmxPage()
Gets the CMX page.
|
ImageOptionsBase |
getDefaultOptions(Object[] args)
Gets the default options.
|
Image |
getDefaultPage()
Gets the default page.
|
CmxDocument |
getDocument()
Gets the CMX document.
|
long |
getFileFormat()
Gets a value of file format
|
float |
getHeightF()
Gets the object height, in inches.
|
int |
getPageCount()
Gets the page count.
|
PageExportingAction |
getPageExportingAction()
Gets the page exporting action.
|
Image[] |
getPages()
Gets the pages.
|
float |
getWidthF()
Gets the object width, in inches.
|
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 |
setPageExportingAction(PageExportingAction value)
Sets the page exporting action.
|
void |
setPalette(IColorPalette palette,
boolean updateColors)
Sets the image palette.
|
getHeight, getWidth
getSizeF
canLoad, canLoad, canLoad, canLoad, canSave, create, getBackgroundColor, getBounds, getBufferSizeHint, getContainer, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getInterruptMonitor, getOriginalOptions, getPalette, getProgressEventHandler, getProgressEventHandlerInfo, 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSizeF
public CmxImage(StreamContainer streamContainer, LoadOptions loadOptions)
Initializes a new instance of the CmxImage
class.
streamContainer
- The stream container.loadOptions
- The load options.public long getFileFormat()
Gets a value of file format
getFileFormat
in class Image
public int getBitsPerPixel()
Gets the image bits per pixel count.
getBitsPerPixel
in class VectorMultipageImage
public Image getDefaultPage()
Gets the default page.
Value: The default page.getDefaultPage
in interface IMultipageImage
getDefaultPage
in class VectorMultipageImage
public boolean isCached()
Gets a value indicating whether object's data is cached currently and no data reading is required.
isCached
in class VectorMultipageImage
public float getWidthF()
Gets the object width, in inches.
getWidthF
in interface IObjectWithSizeF
getWidthF
in class VectorImage
public float getHeightF()
Gets the object height, in inches.
getHeightF
in interface IObjectWithSizeF
getHeightF
in class VectorImage
public final CmxDocument getDocument()
Gets the CMX document.
public final CmxPage getCmxPage()
Gets the CMX page.
getCmxPage
in interface ICmxImage
public int getPageCount()
Gets the page count.
Value: The page count.getPageCount
in interface IMultipageImage
getPageCount
in class VectorMultipageImage
public Image[] getPages()
Gets the pages.
getPages
in interface IMultipageImage
getPages
in class VectorMultipageImage
The following example shows how to cache all pages of a CMX image.
String dir = "c:\\temp\\"; // Load an image from a CMX file. com.aspose.imaging.fileformats.cmx.CmxImage image = (com.aspose.imaging.fileformats.cmx.CmxImage) com.aspose.imaging.Image.load(dir + "sample.cmx"); 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.cmx.CmxImagePage page : image.getPages()) { page.cacheData(); } } finally { image.dispose(); }
public PageExportingAction getPageExportingAction()
Gets the page exporting action. Please note that setting this method will automatically release page resources after it is executed. It will be executed just before each page is saved.
Value: The page exporting action.getPageExportingAction
in interface IMultipageImage
getPageExportingAction
in class VectorMultipageImage
public void setPageExportingAction(PageExportingAction value)
Sets the page exporting action. Please note that setting this method will automatically release page resources after it is executed. It will be executed just before each page is saved.
Value: The page exporting action.setPageExportingAction
in interface IMultipageImage
setPageExportingAction
in class VectorMultipageImage
value
- the page exporting action.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(StreamContainer)
).
cacheData
in class VectorMultipageImage
The following example shows how to cache all pages of a CMX image.
String dir = "c:\\temp\\"; // Load an image from a CMX file. com.aspose.imaging.fileformats.cmx.CmxImage image = (com.aspose.imaging.fileformats.cmx.CmxImage) com.aspose.imaging.Image.load(dir + "sample.cmx"); 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.cmx.CmxImagePage page : image.getPages()) { page.cacheData(); } } finally { image.dispose(); }
public void resize(int newWidth, int newHeight, int resizeType)
Resizes the image.
resize
in class VectorMultipageImage
newWidth
- The new width.newHeight
- The new height.resizeType
- The resize type.public void resize(int newWidth, int newHeight, ImageResizeSettings settings)
Resizes the image.
resize
in class VectorMultipageImage
newWidth
- The new width.newHeight
- The new height.settings
- The resize settings.public void rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the image.
rotateFlip
in class VectorMultipageImage
rotateFlipType
- Type of the rotate flip.public void setPalette(IColorPalette palette, boolean updateColors)
Sets the image palette.
setPalette
in class VectorMultipageImage
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.