java命名空间javax.imageio类iioparam的类成员方法:
setdestinationtype定义及介绍
本文导语:
setdestinationtype
public void setdestinationtype(imagetypespecifier destinationtype)
使用 imagetypespecifier 设置目标图像的所需图像类型。
在读取时,如果已经使用此方法设置目标区域的布局,则每次调用 imagereader 的 read 方法都将返回一个新的...
setdestinationtype
public void setdestinationtype(imagetypespecifier destinationtype)
- 使用
imagetypespecifier 设置目标图像的所需图像类型。
在读取时,如果已经使用此方法设置目标区域的布局,则每次调用 imagereader 的 read 方法都将返回一个新的 bufferedimage,它使用由所提供的类型说明符指定的格式。此方法的一个副作用是,任何由 imagereadparam.setdestination(bufferedimage) 设置的目标 bufferedimage 将不再被设置为目标。换句话说,在调用 setdestination((bufferedimage)null) 时可以考虑此方法。
在写入时,或许会使用目标类型确定图像的颜色类型。samplemodel 信息将被忽略,其可以为 null。例如,一个 4 band 的图像可以表示 cmyk 或 rgba 数据。如果设置了目标类型,则其 colormodel 将重写该图像自身的所有 colormodel。这在使用 setsourcebands 时极其重要,因为该图像的 colormodel 将引用整个图像,而不是被写入的 band 的子集。
- 参数:
destinationtype - 用来确定目标布局和颜色类型的 imagetypespecifier。- 另请参见:
getdestinationtype()