Bitmap. Config and bitmap. config

Source: Internet
Author: User

Bitmap. Config and bitmap. config
Preface

Android is a very memory-intensive system, so we need to be very cautious when using the memory during the process of program development, and Bitmap is the biggest object we come into contact, the following is based on Bitmap. the description of the Config value shows how Bitmap is stored in the memory. Select the appropriate configuration for storing Bitmap according to the actual scenario.

 

Address: http://www.cnblogs.com/luoaz/p/4374886.html

Bitmap. Config

Possible bitmap configurations. A bitmap configuration describes how pixels are stored. This affects the quality (color depth) as well as the ability to display transparent/translucent colors.

This is an enumeration type, which indicates the configuration of Bitmap. A configuration describes how the pixel information is stored. This affects image quality and transparency.

ALPHA_8:Each pixel is stored as a single trans0000cy (alpha) channel.

Each pixel information only stores the alpha information.

ARGB_4444:This field was deprecated in API level 13. Because of the poor quality of this configuration, it is advised to useARGB_8888Instead.

This value is no longer recommended at level 13 because it is a low-quality configuration and is recommendedARGB_8888

ARGB_8888:Each pixel is stored on 4 bytes. This configuration is very flexible and offers the best quality. It shocould be used whenever possible.

Each pixel occupies a storage space of 4 bytes (32 binary bits). alpha, red, green, and blue each occupy 8 binary bits. This configuration item is very flexible and provides the best quality. He should be used whenever possible.

RGB_565:Each pixel is stored on 2 bytes and only the RGB channels are encoded: red is stored with 5 bits of precision (32 possible values ), green is stored with 6 bits of precision (64 possible values) and blue is stored with 5 bits of precision. this configuration may be useful when using opaque bitmaps that do not require high color fidelity

Each pixel information occupies 2 bytes (that is, 16-bit binary) and no alpha information is stored for the RGB information, including Red5, Green6, and Blue5. This configuration item is more useful without transparency.

 

Postscript

The above is a detailed introduction of configuration items. With this knowledge, we will be more comfortable when coming out of the image.

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.