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