If I have a view with a transparent background and I do bitmap = view.getDrawingCache();
, that bitmap is unfortunately no more transparent. A black background is set in background.
I have even tried
view.setDrawingCacheBackgroundColor(Color.TRANSPARENT);
without success.
Actually this method allows to set the background color without any alpha support, Color.TRANSPARENT
which is 0x00000000
is actually black if you don't care about the alpha part...
If I use Color.RED
, the background is indeed very red.
Any idea to make this work? Is this a limitation of current Android API? Can I use draw() instead? but it's less performant that this view.getDrawingCache()
I suppose (no cache)?
Thanks
I also get image with black background by calling getDrawingCache()
method. Actually, the image has transparent background. Mistake is saving the image in jpeg format, so the gallery app shows transparent pixels in black color.
If you put it as an overlay, it'll work perfectly. There is no issue here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With