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

ConstructorDescription
CmxImagePage(CmxPage cmxPage)Initializes a new instance of the CmxImagePage class.

Methods

MethodDescription
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)

public CmxImagePage(CmxPage cmxPage)

Initializes a new instance of the CmxImagePage class.

Parameters:

ParameterTypeDescription
cmxPageCmxPageThe 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:

ParameterTypeDescription
argsjava.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:

ParameterTypeDescription
newWidthintThe new width.
newHeightintThe new height.
resizeTypeintThe resize type.

resize(int newWidth, int newHeight, ImageResizeSettings settings)

public void resize(int newWidth, int newHeight, ImageResizeSettings settings)

Resizes the image.

Parameters:

ParameterTypeDescription
newWidthintThe new width.
newHeightintThe new height.
settingsImageResizeSettingsThe resize settings.

rotateFlip(int rotateFlipType)

public void rotateFlip(int rotateFlipType)

Rotates, flips, or rotates and flips the image.

Parameters:

ParameterTypeDescription
rotateFlipTypeintType of the rotation and flipping.

setPalette(IColorPalette palette, boolean updateColors)

public void setPalette(IColorPalette palette, boolean updateColors)

Sets the image palette.

Parameters:

ParameterTypeDescription
paletteIColorPaletteThe palette to set.
updateColorsbooleanif 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.