|
Foxit PDF SDK
|
Public 成员函数 | |
| Image () throws com.foxit.sdk.PDFException | |
| 构造函数。 更多... | |
| Image (String path) throws com.foxit.sdk.PDFException | |
| 构造函数,从现有图像文件路径。 更多... | |
| Image (byte[] buffer) throws com.foxit.sdk.PDFException | |
| 构造函数,从内存缓冲区。 更多... | |
| Image (FileReaderCallback file_read) throws com.foxit.sdk.PDFException | |
| 构造函数,使用文件读取回调对象。 更多... | |
| Image (Image other) | |
| 构造函数,使用另一个图像对象。 更多... | |
| boolean | addFrame (Bitmap bitmap) throws com.foxit.sdk.PDFException |
| 添加位图作为帧。(不支持的DIB格式:com.foxit.sdk.common.Bitmap.e_DIBRgb565 和 com.foxit.sdk.common.Bitmap.e_DIB8bppMask ) 更多... | |
| synchronized void | delete () |
| 直接清除C++相关资源。 更多... | |
| Bitmap | getFrameBitmap (int index) throws com.foxit.sdk.PDFException |
| 根据索引获取帧位图。 更多... | |
| int | getFrameCount () throws com.foxit.sdk.PDFException |
| 获取帧数。 更多... | |
| int | getHeight () throws com.foxit.sdk.PDFException |
| 获取图像高度。 更多... | |
| int | getOrientation () throws com.foxit.sdk.PDFException |
| 获取图像方向。 更多... | |
| int | getType () throws com.foxit.sdk.PDFException |
| 获取图像类型。 更多... | |
| int | getWidth () throws com.foxit.sdk.PDFException |
| 获取图像宽度。 更多... | |
| int | getXDPI () throws com.foxit.sdk.PDFException |
| 获取X轴的DPI。 更多... | |
| int | getYDPI () throws com.foxit.sdk.PDFException |
| 获取Y轴的DPI。 更多... | |
| boolean | isEmpty () |
| 检查当前对象是否为空。 更多... | |
| boolean | saveAs (String file_path) throws com.foxit.sdk.PDFException |
| 将当前图像保存为图像文件。 更多... | |
| boolean | saveAs (StreamCallback file, String file_extension) throws com.foxit.sdk.PDFException |
| 将当前图像保存为图像文件。 更多... | |
| void | setDPIs (int x_dpi, int y_dpi) throws com.foxit.sdk.PDFException |
| 设置X轴和Y轴的DPI。 更多... | |
Public 成员函数 继承自 com.foxit.sdk.common.Base | |
| synchronized void | delete () |
| 直接清除C++相关资源。 更多... | |
静态 Public 属性 | |
| static final int | e_BMP = 1 |
| 图像类型是BMP。 | |
| static final int | e_GIF = 4 |
| 图像类型是GIF。 | |
| static final int | e_JBIG2 = 8 |
| 图像类型是JBIG2。 更多... | |
| static final int | e_JPG = 2 |
| 图像类型是JPG或JPEG。 | |
| static final int | e_JPX = 6 |
| 图像类型是JPX或JPEG-2000。 | |
| static final int | e_None = 0 |
| 尚未有图像类型。 更多... | |
| static final int | e_OrientationFlipH = 2 |
| 水平翻转。 | |
| static final int | e_OrientationFlipV = 4 |
| 垂直翻转。 | |
| static final int | e_OrientationNone = 0 |
| 无方向。 | |
| static final int | e_OrientationNormal = 1 |
| 正常方向。 | |
| static final int | e_OrientationRotate180 = 3 |
| 顺时针旋转180度。 | |
| static final int | e_OrientationRotate270 = 8 |
| 逆时针旋转90度。 | |
| static final int | e_OrientationRotate270FlipH = 7 |
| 先逆时针旋转90度,然后水平翻转。 | |
| static final int | e_OrientationRotate90 = 6 |
| 顺时针旋转90度。 | |
| static final int | e_OrientationRotate90FlipH = 5 |
| 先顺时针旋转90度,然后水平翻转。 | |
| static final int | e_PNG = 3 |
| 图像类型是PNG。 | |
| static final int | e_TIF = 5 |
| 图像类型是TIF或TIFF。 | |
| static final int | e_Unknown = -1 |
| 未知图像类型。 | |
| static final int | e_WEBP = 9 |
| 图像类型是webp。 更多... | |
Foxit PDF SDK提供以下图像类型:
BMP:位图图像格式。只支持单帧。Foxit PDF SDK支持从BMP图像文件加载图像, 获取一些基本信息,获取其位图,更改其位图并将其保存为图像文件。
JPG:联合图像专家组图像格式。只支持单帧。Foxit PDF SDK支持从JPG图像文件加载图像, 获取一些基本信息,获取其位图,更改其位图并将其保存为图像文件。
PNG:便携式网络图形图像格式。只支持单帧。Foxit PDF SDK支持从PNG图像文件加载图像, 获取一些基本信息,获取其位图,更改其位图并将其保存为图像文件。
GIF:图形交换格式。支持多帧。Foxit PDF SDK支持从GIF图像文件加载图像, 获取其大小,获取其位图,更改其位图并将其保存为图像文件。
TIF:标签图像文件格式。支持多帧。Foxit PDF SDK支持从TIF图像文件加载图像, 获取一些基本信息,获取其位图,更改其位图并将其保存为图像文件。
JPX:JPEG-2000图像格式。只支持单帧。Foxit PDF SDK支持从JPX图像文件加载图像, 获取其大小,获取其位图,更改其位图并将其保存为图像文件。
JBIG2:JBIG2图像格式。只支持单帧。Foxit PDF SDK支持从JBIG2图像文件加载图像, 获取其大小,并将其保存为图像文件。Foxit PDF SDK尚不支持获取其帧位图。
| com.foxit.sdk.common.Image.Image | ( | ) | throws com.foxit.sdk.PDFException |
构造函数。
此构造函数用于构造一个新的图像对象(不包含任何数据)。 此构造的图像对象的图像类型为 com.foxit.sdk.common.Image.e_None 。
| com.foxit.sdk.common.Image.Image | ( | String | path | ) | throws com.foxit.sdk.PDFException |
构造函数,从现有图像文件路径。
| [in] | path | 现有图像文件的完整路径。不应为空字符串。 |
| com.foxit.sdk.common.Image.Image | ( | byte [] | buffer | ) | throws com.foxit.sdk.PDFException |
构造函数,从内存缓冲区。
| [in] | buffer | 内存缓冲区。图像文件数据应完全加载到此内存缓冲区中。 不应为 null。 |
| com.foxit.sdk.common.Image.Image | ( | FileReaderCallback | file_read | ) | throws com.foxit.sdk.PDFException |
构造函数,使用文件读取回调对象。
| [in] | file_read | 用户实现的 com.foxit.sdk.common.fxcrt.FileReaderCallback 对象,用于加载图像文件。 不应为 null。 |
| com.foxit.sdk.common.Image.Image | ( | Image | other | ) |
构造函数,使用另一个图像对象。
| [in] | other | 另一个图像对象。 |
| boolean com.foxit.sdk.common.Image.addFrame | ( | Bitmap | bitmap | ) | throws com.foxit.sdk.PDFException |
添加位图作为帧。(不支持的DIB格式:com.foxit.sdk.common.Bitmap.e_DIBRgb565 和 com.foxit.sdk.common.Bitmap.e_DIB8bppMask )
目前此函数不支持类型为 com.foxit.sdk.common.Image.e_JBIG2 或 com.foxit.sdk.common.Image.e_Unknown 的图像。
对于支持的图像类型:
如果当前图像的类型为 com.foxit.sdk.common.Image.e_TIF 、com.foxit.sdk.common.Image.e_GIF 或 com.foxit.sdk.common.Image.e_None ,此函数将添加新位图 作为新的最后一帧。
如果当前图像的类型为其他类型之一,只包含单帧, 此函数将使用新位图替换第一帧。
| [in] | bitmap | 要添加或设置的有效位图帧。 |
| synchronized void com.foxit.sdk.common.Image.delete | ( | ) |
直接清除C++相关资源。
| Bitmap com.foxit.sdk.common.Image.getFrameBitmap | ( | int | index | ) | throws com.foxit.sdk.PDFException |
根据索引获取帧位图。
目前此函数不支持类型为 com.foxit.sdk.common.Image.e_JBIG2 的图像。 此函数只能支持获取以下格式的帧位图:
com.foxit.sdk.common.Bitmap.e_DIB8bppMask 、com.foxit.sdk.common.Bitmap.e_DIB8bpp 、 com.foxit.sdk.common.Bitmap.e_DIBRgb 、com.foxit.sdk.common.Bitmap.e_DIBRgb32 、 com.foxit.sdk.common.Bitmap.e_DIBArgb 。
对于其他不支持的DIB格式,此函数将返回一个位图对象, 其函数 Bitmap.isEmpty 返回 true。
| [in] | index | 帧的索引。有效范围:从0到(count-1)。 count 由函数 Image.getFrameCount 返回。 |
| int com.foxit.sdk.common.Image.getFrameCount | ( | ) | throws com.foxit.sdk.PDFException |
| int com.foxit.sdk.common.Image.getHeight | ( | ) | throws com.foxit.sdk.PDFException |
获取图像高度。
如果图像有多帧,通常第一帧的大小将被视为图像大小。
| int com.foxit.sdk.common.Image.getOrientation | ( | ) | throws com.foxit.sdk.PDFException |
获取图像方向。
此函数只支持类型为 com.foxit.sdk.common.Image.e_JPG 和 com.foxit.sdk.common.Image.e_TIF 的图像。
| int com.foxit.sdk.common.Image.getType | ( | ) | throws com.foxit.sdk.PDFException |
获取图像类型。
如果当前图像是新图像(不是从任何图像文件构造的),其类型为 com.foxit.sdk.common.Image.e_None 。
| int com.foxit.sdk.common.Image.getWidth | ( | ) | throws com.foxit.sdk.PDFException |
获取图像宽度。
如果图像有多帧,通常第一帧的大小将被视为图像大小。
| int com.foxit.sdk.common.Image.getXDPI | ( | ) | throws com.foxit.sdk.PDFException |
获取X轴的DPI。
目前此函数不支持类型为 com.foxit.sdk.common.Image.e_JPX 、 com.foxit.sdk.common.Image.e_GIF 、com.foxit.sdk.common.Image.e_JBIG2 或 com.foxit.sdk.common.Image.e_WEBP 的图像。
对于新图像(不是从任何图像文件构造的),X轴的默认DPI为96。
| int com.foxit.sdk.common.Image.getYDPI | ( | ) | throws com.foxit.sdk.PDFException |
获取Y轴的DPI。
目前此函数不支持类型为 com.foxit.sdk.common.Image.e_JPX 、 com.foxit.sdk.common.Image.e_GIF 、com.foxit.sdk.common.Image.e_JBIG2 或 com.foxit.sdk.common.Image.e_WEBP 的图像。
对于新图像(不是从任何图像文件构造的),Y轴的默认DPI为96。
| boolean com.foxit.sdk.common.Image.isEmpty | ( | ) |
检查当前对象是否为空。
当前对象为空时,表示当前对象无用。
| boolean com.foxit.sdk.common.Image.saveAs | ( | String | file_path | ) | throws com.foxit.sdk.PDFException |
将当前图像保存为图像文件。
如果当前图像的类型为 com.foxit.sdk.common.Image.e_TIF 、com.foxit.sdk.common.Image.e_GIF 或 com.foxit.sdk.common.Image.e_None ,且保存的图像文件类型不支持多帧, 则只有当前图像的第一帧会被保存到图像文件中。
如果保存的图像文件类型为 com.foxit.sdk.common.Image.e_WEBP ,当前图像的位图格式 应为 com.foxit.sdk.common.Bitmap.e_DIBRgb 、 或 。
对于图像对象(不是从任何图像文件构造的),请确保在使用此函数之前 至少向图像对象添加一个有效的帧位图; 否则此函数将失败。
| [in] | file_path | 保存的图像文件的完整路径。不应为空字符串。 目前此函数支持以下扩展名: .bmp、.jpg、.jpeg、.png、.tif、.tiff、.jpx、.jp2。 |
使用当前函数将当前图像对象保存到临时文件。这里,此临时文件 命名为"temp.tmp"。
确保当前图像对象已析构。
删除"org.bmp"并将"temp.tmp"重命名为"org.bmp"。
| boolean com.foxit.sdk.common.Image.saveAs | ( | StreamCallback | file, |
| String | file_extension | ||
| ) | throws com.foxit.sdk.PDFException |
将当前图像保存为图像文件。
如果当前图像的类型为 com.foxit.sdk.common.Image.e_TIF 、com.foxit.sdk.common.Image.e_GIF 或 com.foxit.sdk.common.Image.e_None ,且保存的图像文件类型不支持多帧, 则只有当前图像的第一帧会被保存到图像文件中。
如果保存的图像文件类型为 com.foxit.sdk.common.Image.e_WEBP ,当前图像的位图格式 应为 com.foxit.sdk.common.Bitmap.e_DIBRgb 、 或 。
对于图像对象(不是从任何图像文件构造的),请确保在使用此函数之前 至少向图像对象添加一个有效的帧位图; 否则此函数将失败。
| [in] | file | 用户实现的 com.foxit.sdk.common.fxcrt.StreamCallback 对象,用于保存图像文件。 |
| [in] | file_extension | 保存的图像文件的完整路径。不应为空字符串。 目前此函数支持以下扩展名: .bmp、.jpg、.jpeg、.png、.tif、.tiff、.jpx、.jp2。 |
使用当前函数将当前图像对象保存到临时文件。这里,此临时文件 命名为"temp.tmp"。
确保当前图像对象已析构。
删除"org.bmp"并将"temp.tmp"重命名为"org.bmp"。
| void com.foxit.sdk.common.Image.setDPIs | ( | int | x_dpi, |
| int | y_dpi | ||
| ) | throws com.foxit.sdk.PDFException |
设置X轴和Y轴的DPI。
目前此函数不支持类型为 com.foxit.sdk.common.Image.e_JPX 、 com.foxit.sdk.common.Image.e_GIF 、com.foxit.sdk.common.Image.e_JBIG2 或 com.foxit.sdk.common.Image.e_WEBP 的图像。
| [in] | x_dpi | X轴的DPI。应大于0。 |
| [in] | y_dpi | Y轴的DPI。应大于0。 |
|
static |
图像类型是JBIG2。
|
static |
尚未有图像类型。
|
static |
图像类型是webp。