CmxImagePage
Inheritance: java.lang.Object, com.aspose.imaging.DisposableObject, com.aspose.imaging.DataStreamSupporter, com.aspose.imaging.Image, com.aspose.imaging.VectorImage
All Implemented Interfaces: com.aspose.imaging.fileformats.cmx.ICmxImage
public class CmxImagePage extends VectorImage implements ICmxImage
The image of CMX page
Constructors
Constructor | Description |
---|---|
CmxImagePage(CmxPage cmxPage, Image container) | Initializes a new instance of the CmxImagePage class. |
CmxImagePage(CmxPage cmxPage) | Initializes a new instance of the CmxImagePage class. |
Methods
Method | Description |
---|---|
getCmxPage() | Gets the CMX page. |
getFileFormat() | Gets a value of file format |
getBitsPerPixel() | Gets the image bits per pixel count. |
isCached() | Gets a value indicating whether object’s data is cached currently and no data reading is required. |
getWidthF() | Gets the object width, in inches. |
getHeightF() | Gets the object height, in inches. |
getDefaultOptions(Object[] args) | Gets the default options. |
cacheData() | Cache can not be used. |
resize(int newWidth, int newHeight, int resizeType) | Resizes the image. |
resize(int newWidth, int newHeight, ImageResizeSettings settings) | Resizes the image. |
rotateFlip(int rotateFlipType) | Rotates, flips, or rotates and flips the image. |
setPalette(IColorPalette palette, boolean updateColors) | Sets the image palette. |
CmxImagePage(CmxPage cmxPage, Image container)
public CmxImagePage(CmxPage cmxPage, Image container)
Initializes a new instance of the CmxImagePage class.
Parameters:
Parameter | Type | Description |
---|---|---|
cmxPage | CmxPage | The CMX page. |
container | Image | The container. |
CmxImagePage(CmxPage cmxPage)
public CmxImagePage(CmxPage cmxPage)
Initializes a new instance of the CmxImagePage class.
Parameters:
Parameter | Type | Description |
---|---|---|
cmxPage | CmxPage | The CMX page. |
getCmxPage()
public final CmxPage getCmxPage()
Gets the CMX page.
Returns: CmxPage - the CMX page.
getFileFormat()
public long getFileFormat()
Gets a value of file format
Returns: long - a value of file format
getBitsPerPixel()
public int getBitsPerPixel()
Gets the image bits per pixel count.
Returns: int - the image bits per pixel count.
isCached()
public 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
.
Returns: boolean - a value indicating whether object’s data is cached currently and no data reading is required.
getWidthF()
public float getWidthF()
Gets the object width, in inches.
Returns: float - the object width, in inches.
getHeightF()
public float getHeightF()
Gets the object height, in inches.
Returns: float - the object height, in inches.
getDefaultOptions(Object[] args)
public ImageOptionsBase getDefaultOptions(Object[] args)
Gets the default options.
Parameters:
Parameter | Type | Description |
---|---|---|
args | java.lang.Object[] | The arguments. |
Returns: ImageOptionsBase - Default options
cacheData()
public void cacheData()
Cache can not be used.
Example: 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();
}
resize(int newWidth, int newHeight, int resizeType)
public void resize(int newWidth, int newHeight, int resizeType)
Resizes the image.
Parameters:
Parameter | Type | Description |
---|---|---|
newWidth | int | The new width. |
newHeight | int | The new height. |
resizeType | int | The resize type. |
resize(int newWidth, int newHeight, ImageResizeSettings settings)
public void resize(int newWidth, int newHeight, ImageResizeSettings settings)
Resizes the image.
Parameters:
Parameter | Type | Description |
---|---|---|
newWidth | int | The new width. |
newHeight | int | The new height. |
settings | ImageResizeSettings | The resize settings. |
rotateFlip(int rotateFlipType)
public void rotateFlip(int rotateFlipType)
Rotates, flips, or rotates and flips the image.
Parameters:
Parameter | Type | Description |
---|---|---|
rotateFlipType | int | Type of the rotation and flipping. |
setPalette(IColorPalette palette, boolean updateColors)
public void setPalette(IColorPalette palette, boolean updateColors)
Sets the image palette.
Parameters:
Parameter | Type | Description |
---|---|---|
palette | IColorPalette | The palette to set. |
updateColors | boolean | 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. |