The Bitmap.Config.RGB_565 of Android development

Source: Internet
Author: User

When you learn the Xutils framework, you see a line of code in the sample code:

1 bitmaputils.configdefaultbitmapconfig (Bitmap.Config.RGB_565);

What does Bitmap.Config.RGB_565 mean?

Bitmap.config is an inner class within the Android.graphics.Bitmap class, in the Bitmap class CreateBitmap (int width, int height, bitmap.config Config) method will be used to open this class

Enumeration variables
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

Alpha_8, what is argb_4444,argb_8888,rgb_565?

In fact, this is the color of the storage method: We know that ARGB refers to a color model, where a for Alpha,r said Red,g said Green,b said Blue, in fact, all the visible color is the right red and green blue, so red and green blue is also called the three primary colors, Each primary color stores the information values of the colors represented

In plain alpha_8, Alpha is made up of 8 bits.
The argb_4444 is made up of 4 4-bit, or 16-bit,
The argb_8888 is made up of 4 8-bit, or 32-bit,
Rgb_565 is R is 5 bits, G is 6 bits, B is 5 bits total 16 bits

Thus:
Alpha_8 represents a 8-bit alpha bitmap
argb_4444 represents a 16-bit ARGB bitmap
argb_8888 represents a 32-bit ARGB bitmap
rgb_565 represents a 8-bit RGB bitmap

A higher number of bitmap bits means that the more color information they can store, the more realistic the image is.

The Bitmap.Config.RGB_565 of Android development

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.