android - BitmapFactory.decodeByteArray doesn't keep color information when pixel is fully transparent -


i use bitmapfactory.decodebytearray generate bitmap png image. use bitmap.getpixels retrive pixel data. problem when pixel set transparent, color data seams discarded. 0x0000ff00 being returned 0x00000000. if create image code has transparent pixels make copy, render canvas, use canvas.drawcolor(0xff000000, mode.dst_atop) , correct color values getpixels , add alpha values got first getpixels call. can't since color information seams gone. there way make sure color information stored when generating bitmap png file using bitmapfactory?

try setting bitmapfactory.options.indither = false, should trick. took wisdom here.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -