java命名空间javax.imageio类imagereader的类成员方法:
readasrenderedimage定义及介绍
本文导语:
readasrenderedimage
public renderedimage readasrenderedimage(int imageindex,
imagereadparam param)
throws ioexception
返回一个 renderedimage 对象,该对象包含通过索引 imageindex 指定的图像的内容。...
readasrenderedimage
public renderedimage readasrenderedimage(int imageindex,
imagereadparam param)
throws ioexception
- 返回一个
renderedimage 对象,该对象包含通过索引 imageindex 指定的图像的内容。默认情况下,返回的图像是由 read(imageindex, param) 返回的 bufferedimage。
此方法的语义在某些方面可能不同于其他 read 方法的语义。首先,可以忽略 imagereadparam 中设置的任何目标图像和/或图像类型。其次,不保证进行一般的侦听器调用,或者进行这些调用时不保证它们是有意义的。这是因为在返回时(甚至任何时候)返回的图像可能并不完全由像素数据填充。
如果所提供的 imagereadparam 包含不受此 reader 支持的可选设置值(例如 源呈现大小或任何特定于格式的设置),则将忽略这些设置。
默认实现调用 read(imageindex, param)。
- 参数:
imageindex - 将被获取的图像的索引。param - 用来控制读取过程的 imagereadparam,或者为 null。
- 返回:
- 提供图像视图的
renderedimage 对象。
- 抛出:
illegalstateexception - 如果尚未设置输入源。
indexoutofboundsexception - 如果所提供的索引超出范围。
illegalargumentexception - 如果由 param.getsourcebands 和 param.getdestinationbands 指定的源 band 和目标 band 的集合在长度上不同,或者包含超出范围的索引。
illegalargumentexception - 如果所得图像的视图
iis7站长之家或高度小于 1。
ioexception - 如果读取期间发生错误。