java命名空间javax.imageio类imagereader的类成员方法:
readthumbnail定义及介绍
本文导语:
readthumbnail
public bufferedimage readthumbnail(int imageindex,
int thumbnailindex)
throws ioexception
以 bufferedimage 形式返回通过索引 thumbnailindex 指定的缩略图预览图像,其与通过索引 imageindex 指定...
readthumbnail
public bufferedimage readthumbnail(int imageindex,
int thumbnailindex)
throws ioexception
- 以
bufferedimage 形式返回通过索引 thumbnailindex 指定的缩略图预览图像,其与通过索引 imageindex 指定的图像关联。
所有已注册 iioreadprogresslistener 对象都将通过调用其 thumbnailstarted、thumbnailprogress 和 thumbnailcomplete 方法获得通知。
如果 reader 不支持缩略图(readersupportsthumbnails 返回 false),则无论是否已经设置了输入源或者索引是否在范围内,其都将抛出 unsupportedoperationexception。
默认的实现抛出 unsupportedoperationexception。
- 参数:
imageindex - 将被获取的图像的索引。thumbnailindex - 将被获取的缩略图的索引。
- 返回:
bufferedimage 形式的所需缩略图。
- 抛出:
unsupportedoperationexception - 如果不支持缩略图。
illegalstateexception - 如果尚未设置输入源。
indexoutofboundsexception - 如果任何一个所提供的索引超出范围。
ioexception - 如果在读取过程中发生错误。