- java.lang.Object
-
- javax.imageio.IIOParam
-
- javax.imageio.ImageWriteParam
-
- javax.imageio.plugins.bmp.BMPImageWriteParam
-
public class BMPImageWriteParam extends ImageWriteParam
用于编码BMP格式的图像的ImageWriteParam
的子类。该类允许在编写BMP格式的图像文件时规定各种参数。 默认情况下,数据布局是自下而上的,像素以自下而上的顺序存储,第一条扫描线最后存储。
可以使用具有相应类型字符串的
setCompressionType()
方法来指定要使用的特定压缩方案。 当且仅当与要写入的图像类型兼容时,才能使用指定的压缩方案。 如果指定的压缩方案与正在写入的图像类型不兼容,那么BMP图像编写IOException
将抛出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/sample
-
-
Field Summary
-
Fields inherited from class javax.imageio.IIOParam
controller, defaultController, destinationOffset, destinationType, sourceBands, sourceRegion, sourceXSubsampling, sourceYSubsampling, subsamplingXOffset, subsamplingYOffset
-
Fields inherited from class javax.imageio.ImageWriteParam
canOffsetTiles, 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
-
-
构造方法摘要
构造方法 Constructor 描述 BMPImageWriteParam()
构造一个BMPImageWriteParam
对象,其所有参数的默认值为null Locale
。BMPImageWriteParam(Locale locale)
构造一个BMPImageWriteParam
集,以使用给定的Locale
和所有参数的默认值。
-
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 boolean
isTopDown()
返回topDown
参数的值。void
setTopDown(boolean topDown)
如果设置,数据将以自上而下的方式写出,第一条扫描线首先写入。-
Methods inherited from class javax.imageio.IIOParam
activateController, getController, getDefaultController, getDestinationOffset, getDestinationType, getSourceBands, getSourceRegion, getSourceXSubsampling, getSourceYSubsampling, getSubsamplingXOffset, getSubsamplingYOffset, hasController, setController, setDestinationOffset, setDestinationType, setSourceBands, setSourceRegion, setSourceSubsampling
-
Methods inherited from class javax.imageio.ImageWriteParam
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
-
-
-
-
构造方法详细信息
-
BMPImageWriteParam
public BMPImageWriteParam(Locale locale)
构造一个BMPImageWriteParam
集,以使用给定的Locale
和所有参数的默认值。- 参数
-
locale
-一个Locale
使用本地化压缩类型名称和质量描述,或null
。
-
BMPImageWriteParam
public BMPImageWriteParam()
构造一个BMPImageWriteParam
对象,其中所有参数的默认值为null Locale
。
-
-