Android Bitmap. Config

Source: Internet
Author: User

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"
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.