Android的Bitmap.Config中ALPHA_8、ARGB_4444、ARGB_8888和RGB_565

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 use ARGB_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位。這個配置項在不需要提供透明度的情況下更有用。

480*800分辨率佔用的內存空間是:480*800*4/(1024*1024)=1.5M

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章