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

CMX 页面图像

构造函数

构造函数描述
CmxImagePage(CmxPage cmxPage, Image container)初始化 CmxImagePage 类的新实例。
CmxImagePage(CmxPage cmxPage)初始化 CmxImagePage 类的新实例。

方法

方法描述
getCmxPage()获取 CMX 页面。
getFileFormat()获取文件格式的值
getBitsPerPixel()获取图像每像素位数计数。
isCached()获取一个值,指示对象的数据当前是否已缓存且无需读取数据。
getWidthF()获取对象的宽度(英寸)。
getHeightF()获取对象的高度(英寸)。
getWidth()获取图像宽度。
getHeight()获取图像高度。
getDefaultOptions(Object[] args)获取默认选项。
cacheData()缓存无法使用。
setPalette(IColorPalette palette, boolean updateColors)设置图像调色板。

CmxImagePage(CmxPage cmxPage, Image container)

public CmxImagePage(CmxPage cmxPage, Image container)

初始化 CmxImagePage 类的新实例。

Parameters:

参数类型描述
cmxPageCmxPageCMX 页面。
containerImage容器。

CmxImagePage(CmxPage cmxPage)

public CmxImagePage(CmxPage cmxPage)

初始化 CmxImagePage 类的新实例。

Parameters:

参数类型描述
cmxPageCmxPageCMX 页面。

getCmxPage()

public final CmxPage getCmxPage()

获取 CMX 页面。

Returns: CmxPage - the CMX page.

getFileFormat()

public long getFileFormat()

获取文件格式的值

Returns: long - 文件格式的值

getBitsPerPixel()

public int getBitsPerPixel()

获取图像每像素位数计数。

Returns: int - 图像每像素位数。

isCached()

public boolean isCached()

获取一个值,指示对象的数据当前是否已缓存且无需读取数据。

值:如果对象的数据已缓存则为 true;否则为 false

Returns: boolean - 一个值,指示对象的数据当前是否已缓存且无需读取数据。

getWidthF()

public float getWidthF()

获取对象的宽度(英寸)。

Returns: float - 对象的宽度(英寸)。

getHeightF()

public float getHeightF()

获取对象的高度(英寸)。

Returns: float - 对象的高度(英寸)。

getWidth()

public int getWidth()

获取图像宽度。

值:图像宽度。

Returns: int - 图像宽度。

getHeight()

public int getHeight()

获取图像高度。

值:图像高度。

Returns: int - 图像高度。

getDefaultOptions(Object[] args)

public ImageOptionsBase getDefaultOptions(Object[] args)

获取默认选项。

Parameters:

参数类型描述
argsjava.lang.Object[]参数。

Returns: ImageOptionsBase - Default options

cacheData()

public void cacheData()

缓存无法使用。

Example: The following example shows how to cache all pages of a CMX image.

String dir = "c:\\temp\\";

// 从 CMX 文件加载图像。
com.aspose.imaging.fileformats.cmx.CmxImage image = (com.aspose.imaging.fileformats.cmx.CmxImage) com.aspose.imaging.Image.load(dir + "sample.cmx");
try {
    // 此调用仅缓存默认页面。
    image.cacheData();

    // 缓存所有页面,以便不再从底层数据流加载额外数据。
    for (com.aspose.imaging.fileformats.cmx.CmxImagePage page : image.getPages()) {
        page.cacheData();
    }
} finally {
    image.dispose();
}

setPalette(IColorPalette palette, boolean updateColors)

public void setPalette(IColorPalette palette, boolean updateColors)

设置图像调色板。

Parameters:

参数类型描述
paletteIColorPalette要设置的调色板。
updateColorsboolean如果设置为 true,颜色将根据新调色板进行更新;否则颜色索引保持不变。请注意,如果某些索引没有对应的调色板条目,未更改的索引可能在加载时导致图像崩溃。