public class BMPImageWriteParam extends ImageWriteParam
ImageWriteParam
的子类。
该类允许在编写BMP格式的图像文件时规定各种参数。 默认情况下,数据布局是自下而上的,像素以自下而上的顺序存储,第一条扫描线最后存储。
可以使用具有相应类型字符串的setCompressionType()
方法来指定要使用的特定压缩方案。 当且仅当与要写入的图像类型兼容时,才能使用指定的压缩方案。 如果指定的压缩方案与正在写入的图像类型不兼容,则BMP图像编写器将抛出IOException
。 如果压缩类型未明确设置,那么getCompressionType()
将返回null
。 在这种情况下,BMP图像编写器将选择支持给定图像编码的压缩类型,而不会损失颜色分辨率。
压缩类型字符串和每种支持的图像类型列在下表中:
Compression Types Type String Description Image Types BI_RGB Uncompressed RLE <= 8-bits/sample BI_RLE8 8-bit Run Length Encoding <= 8-bits/sample BI_RLE4 4-bit Run Length Encoding <= 4-bits/sample BI_BITFIELDS Packed data 16 or 32 bits/samplecanOffsetTiles, canWriteCompressed, canWriteProgressive, canWriteTiles, compressionMode, compressionQuality, compressionType, compressionTypes, locale, MODE_COPY_FROM_METADATA, MODE_DEFAULT, MODE_DISABLED, MODE_EXPLICIT, preferredTileSizes, progressiveMode, tileGridXOffset, tileGridYOffset, tileHeight, tileWidth, tilingMode, tilingSet
controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffset
Constructor and Description |
---|
BMPImageWriteParam()
构造一个
BMPImageWriteParam 对象,其默认值为所有参数和
null
Locale 。
|
BMPImageWriteParam(Locale locale)
构造一个
BMPImageWriteParam 设置以使用给定的
Locale 和所有参数的默认值。
|
Modifier and Type | Method and Description |
---|---|
boolean |
isTopDown()
返回
topDown 参数的值。
|
void |
setTopDown(boolean topDown)
如果设置,数据将以自上而下的方式写出,第一条扫描线首先写入。
|
canOffsetTiles, canWriteCompressed, canWriteProgressive, canWriteTiles, getBitRate, getCompressionMode, getCompressionQuality, getCompressionQualityDescriptions, getCompressionQualityValues, getCompressionType, getCompressionTypes, getLocale, getLocalizedCompressionTypeName, getPreferredTileSizes, getProgressiveMode, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getTilingMode, isCompressionLossless, setCompressionMode, setCompressionQuality, setCompressionType, setProgressiveMode, setTiling, setTilingMode, unsetCompression, unsetTiling
activateController, getController, getDefaultController, getDestinationOffset, getDestinationType, getSourceBands, getSourceRegion, getSourceXSubsampling, getSourceYSubsampling, getSubsamplingXOffset, getSubsamplingYOffset, hasController, setController, setDestinationOffset, setDestinationType, setSourceBands, setSourceRegion, setSourceSubsampling
public BMPImageWriteParam(Locale locale)
BMPImageWriteParam
设置以使用给定的
Locale
和所有参数的默认值。
locale
-一个
Locale
被用于本地化压缩类型名称和质量描述,或
null
。
public BMPImageWriteParam()
BMPImageWriteParam
对象,其默认值为所有参数,
null
Locale
。
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.