Android. graphics. Bitmap. Config & lt; ALPHA_8, ARGB_44

Source: Internet
Author: User

I recently learned the Api documentation and opened Android. graphics. the Bitmap class has an internal class Bitmap. config class. In the Bitmap class, createBitmap (int width, int height, Bitmap. config config ).

Enumerated variable
Public static final Bitmap. Config ALPHA_8
Public static final Bitmap. Config ARGB_4444
Public static final Bitmap. Config ARGB_8888
Public static final Bitmap. Config RGB_565

It seems a bit blind. What is ALPHA_8, ARGB_4444, ARGB_8888, and RGB_565?

In fact, this is the color storage method: We know that ARGB refers to A color mode, in which A represents Alpha, R represents red, G Represents green, B Represents blue, in fact, all visible colors are composed of red, green, and blue on the right. Therefore, red, green, and blue are also called primary colors. Each primary color stores the information values of the displayed colors.

To put it bluntly, ALPHA_8 is an Alpha consisting of eight digits.
ARGB_4444 is composed of four digits, that is, 16 digits,
ARGB_8888 is composed of four eight digits, namely, 32 digits,
RGB_565 indicates that R is 5 bits, G is 6 bits, and B is 5 bits, a total of 16 bits

It can be seen that:
ALPHA_8 represents an 8-bit Alpha bitmap
ARGB_4444 represents a 16-bit ARGB bitmap
ARGB_8888 represents 32-bit ARGB bitmap
RGB_565 represents an 8-bit RGB bitmap.

The higher the number of Bitmap digits, the more color information it can store. Of course, the more vivid the image is.


From caikezhan

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.