java命名空间javax.imageio类imagereader的类成员方法:
read定义及介绍
本文导语:
read
public bufferedimage read(int imageindex)
throws ioexception
使用默认 imagereadparam 读取通过索引 imageindex 指定的图像,并将其作为一个完整的 bufferedimage 返回。这是一个调用 read(imageindex, null) 的便捷方法。
返回的图像将...
read
public bufferedimage read(int imageindex)
throws ioexception
- 使用默认
imagereadparam 读取通过索引 imageindex 指定的图像,并将其作为一个完整的 bufferedimage 返回。这是一个调用 read(imageindex, null) 的便捷方法。
返回的图像将根据从 getimagetypes 中返回的第一个 imagetypespecifier 进行格式化。
所有已注册的 iioreadprogresslistener 对象将通过以下方式获得通知:首先调用其 imagestarted 方法,然后在读取过程中调用其 imageprogress 方法。最后,将调用其 imagecomplete 方法。解码像素时,iioreadupdatelistener 对象可以在读取期间的其他时间更新。最后,iioreadwarninglistener 对象将接收解码期间发生的所有非致命警告。
- 参数:
imageindex - 将被获取的图像的索引。
- 返回:
bufferedimage 形式的所需图像部分。
- 抛出:
illegalstateexception - 如果尚未设置输入源。
indexoutofboundsexception - 如果所提供的索引超出范围。
ioexception - 如果在读取过程中发生错误。