Dec 10, 2008, 2:26:59 PM12/10/08
to Android Developers
I'm trying to use Canvas.drawBitmap(int colors, int offset, int
stride, int x, int y, int width, int height, boolean hasAlpha, Paint
paint) to draw an integer color array containing an image pixels array
in the format of ARGB_8888 (with alpha channel).
This function is provided in SDK 1.0 to draw a color pixel array
directly without creating an intermediate Bitmap. However, I found
this function does not perform alpha blending at all.
The attached picture is the screen shot of my test result. Left screen
shot is the correct result if I create a Bitmap from the color array
first then draw the created Bitmap. Right screen shot is the wrong
result if I draw the color array directly. I noticed in the wrong
rendering, all pixels are treated as either completely opaque or
completely transparent. if a pixel has a alpha value other than 0xFF
or 0x00 (translucent pixel), it will be rendered incorrectly.
I hope anyone in Android team can give some suggestions for this
issue. I'm currently thinking this is a bug.