Android Learning notes Advanced 14 pixel operation

Source: Internet
Author: User

In the game we play we often see some of the effects of images, such as translucent and other effects. To achieve this translucent effect is not difficult, we need to understand the operation of image pixels.

Don't be afraid, actually bitmap in Android gives us the basic way to manipulate pixels.

We can get the pixel of the image through the Getpixels () method and put it in an array, and we can manipulate the array. Finally, the array is set to bitmap by the setpixels () method.

In Android, each image pixel is represented by a 4-byte integer: The highest byte is used as the alpha channel, which is used for transparent and opaque control, 255 for completely opaque, 0 for full transparency, the next byte is the Red Red channel, and 255 for the full red envelope. The next two bytes, in turn, implement the green and blue channels accordingly.

Android Learning notes Advanced 14 pixel operation

Related Article

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.