I'm confused about PixelFormat on Android.
My device is Motorola Defy.
I have two questions:
- On Android 2.3
getWindowManager().getDefaultDisplay().getPixelFormat()returns 4 what stands for RGB_565. As far as I know my device has 16M colors, that means 3 (or 4 with alpha channel) bytes per pixel:
2^(8*3) = 2^24 = 16M
But RGB_565 format has 2 bytes (16 bits) per pixel, what stands for 65K colors:
2^(8*2) = 2^16 = 65K
So, why getPixelFormat() doesn't return format with 3 (or 4 like RGBA) bytes per pixel? Is it display driver problems or something? Can I set PixelFormat to RGBA_8888 (or analogue)?
- On Android 4.1 (custom rom),
getPixelFormat()returns 5. But this value is undocumented. What does it stand for? Actually, in this situation effect is the same as with constant4. But from this discussion I found that 5 stands forRGBA_8888(but there is no proof for that statement). So how can I figure out the real format of device's screen? Also I found one Chinese device on Android 2.2, that also hasPixelFormat5, but the real format is 4 (as my Motorola).
I have googled these questions and found nothing. The only thing I found is that nexus 7 also has 5 format.
Update:
I found method getWindow().setFormat() but it actually does not change main pixel format.