Bitmap中的config

来源:互联网 发布:python inceptor 编辑:程序博客网 时间:2024/05/19 03:42

Bitmap.Config

  Possible bitmap configurations. A bitmap configuration describes how pixels are stored. This affects the quality (color depth) as well as the ability to display transparent/translucent colors.

  首先这是一个枚举型,它代表了Bitmap可以的配置情况。一个配置描述的是这些像素信息是如何存储的。这个影响到了图片质量和透明度。

ALPHA_8:Each pixel is stored as a single translucency (alpha) channel.

      每个像素信息只存储了alpha这一项信息。

ARGB_4444:This field was deprecated in API level 13. Because of the poor quality of this configuration, it is advised to useARGB_8888 instead. 

     这个值在level 13的时候就已经不被建议使用了,因为他是一个低质量的配置,它被建议使用ARGB_8888

ARGB_8888:Each pixel is stored on 4 bytes. This configuration is very flexible and offers the best quality. It should be used whenever possible.

     每个像素信息占用4个字节(即32个二进制位)的存储空间,alpha、red、green、blue各占8个二进制位。这个配置项是非常灵活,并提供了最好的质量。他应该在可能的情况下尽量被使用。

RGB_565:Each pixel is stored on 2 bytes and only the RGB channels are encoded: red is stored with 5 bits of precision (32 possible values), green is stored with 6 bits of precision (64 possible values) and blue is stored with 5 bits of precision.This configuration may be useful when using opaque bitmaps that do not require high color fidelity

     每个像素信息占用2个字节(即16位二进制位)并且至存储了RGB的信息没有alpha信息,其中Red5位,Green6位,Blue5位。这个配置项在不需要提供透明度的情况下更有用。

0 0
原创粉丝点击