java命名空间javax.imageio类imagewriteparam的类成员方法:
setcompressiontype定义及介绍
本文导语:
setcompressiontype
public void setcompressiontype(string compressiontype)
将压缩类型设置为 getcompressiontypes 指示的值之一。如果传入的是 null 值,则移除所有以前的设置。
默认实现检查是否支持压缩,以及压缩模式是否为 mode_explicit。如果...
setcompressiontype
public void setcompressiontype(string compressiontype)
- 将压缩类型设置为
getcompressiontypes 指示的值之一。如果传入的是 null 值,则移除所有以前的设置。
默认实现检查是否支持压缩,以及压缩模式是否为 mode_explicit。如果是,则调用 getcompressiontypes 并检查 compressiontype 是否是合法值之一。如果是合法值,则设置 compressiontype 实例变量。如果 compressiontype 为 null,则设置该实例变量而不执行任何检查。
- 参数:
compressiontype - 由 getcompressiontypes 返回的 string 之一;或者为 null,表示移除所有以前的设置。
- 抛出:
unsupportedoperationexception - 如果 writer 不支持压缩。
illegalstateexception - 如果压缩模式不是 mode_explicit。
unsupportedoperationexception - 如果没有可设置的压缩类型。
illegalargumentexception - 如果 compressiontype 为非 null 但不是 getcompressiontypes 返回的值之一。- 另请参见:
getcompressiontypes(),
getcompressiontype(),
unsetcompression()