Bitmap. Config has four parameters:
Java code
Bitmap. Config ALPHA_8
Bitmap. Config ARGB_4444
Bitmap. Config ARGB_8888
Bitmap. Config RGB_565
First
Java code
A: Alpha transparency
R: Red
G: Green
B: Blue
Then
Java code
Bitmap. Config ALPHA_8 image parameters should be represented by one byte, which should be an 8-Bit Bitmap.
Bitmap. Config ARGB_4444 image parameters should be represented by two bytes, each of which uses 4 bits to record A, R, G, and B data of each pixel, and A 16-color Bitmap
Bitmap. the parameters of the Config ARGB_8888 image should be represented in four bytes. Eight bits are used to record the, R, G, and B data of each pixel, respectively, 32-Bit Bitmap and 256-color Bitmap (this may also be a 24-Bit Bitmap like RGB888)
Bitmap. the parameters of the Config RGB_565 image should be expressed in two bytes, respectively using five, six, and five bits to record the R, G, and B data of pixels, one of the six bits of G is invalid and retained, 32-color bitmap
Generally, we use ARGB_8888, but it also occupies a relatively large amount of memory.
Because a pixel is 8 + 8 + 8 + 8 = 32-bit 8-bit and one byte, that is, a pixel 4-byte. If the image is 800*480, that is, 800*480*4/1024/ 124 is estimated to be more than 1 m.
As a mobile app developer, your memory usage is limited.
Author "TryLoveCatch"