public class CmxImage extends VectorMultipageImage implements ICmxImage
The CMX image.
ImageThe 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()
Deprecated.
Please use getPages()[index]
|
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.
|
getEmbeddedImages, getHeight, getWidthgetSizeFcanLoad, canLoad, canLoad, canLoad, canSave, create, create, create, getBackgroundColor, getBounds, getBufferSizeHint, getContainer, getFileFormat, getFileFormat, getFittingRectangle, getFittingRectangle, getInterruptMonitor, getOriginalOptions, getPalette, getProgressEventHandler, getProgressEventHandlerInfo, getProportionalHeight, getProportionalWidth, getSize, 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, getDisposedequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetSizeFpublic 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 ImageFileFormatpublic int getBitsPerPixel()
Gets the image bits per pixel count.
getBitsPerPixel in class VectorMultipageImage@Deprecated public Image getDefaultPage()
Gets the default page.
getDefaultPage in interface IMultipageImageCmxImage.getPages()public boolean isCached()
Gets a value indicating whether object's data is cached currently and no data reading is required.
isCached in class VectorMultipageImagepublic float getWidthF()
Gets the object width, in inches.
getWidthF in interface IObjectWithSizeFgetWidthF in class VectorImagepublic float getHeightF()
Gets the object height, in inches.
getHeightF in interface IObjectWithSizeFgetHeightF in class VectorImagepublic final CmxDocument getDocument()
Gets the CMX document.
public final CmxPage getCmxPage()
Gets the CMX page.
getCmxPage in interface ICmxImagepublic int getPageCount()
Gets the page count.
Value: The page count.getPageCount in interface IMultipageImagepublic Image[] getPages()
Gets the pages.
getPages in interface IMultipageImageThe 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 IMultipageImagegetPageExportingAction in class VectorMultipageImagepublic 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 IMultipageImagesetPageExportingAction in class VectorMultipageImagevalue - the page exporting action.public ImageOptionsBase getDefaultOptions(Object[] args)
Gets the default options.
getDefaultOptions in class Imageargs - 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 VectorMultipageImageThe 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 VectorMultipageImagenewWidth - 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 VectorMultipageImagenewWidth - 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 VectorMultipageImagerotateFlipType - Type of the rotate flip.public void setPalette(IColorPalette palette, boolean updateColors)
Sets the image palette.
setPalette in class VectorMultipageImagepalette - 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.Copyright (c) 2008-2022 Aspose Pty Ltd. All Rights Reserved.