I use the code below to draw a view on to a bitmap/canvas.
Bitmap bitmap = Bitmap.createBitmap(
viewGroup.getWidth (), viewGroup.getHeight (), Bitmap.Config.ARGB_8888);
viewGroup.draw(new Canvas(bitmap));
It works great, with one small problem: it doesn't draw elevation shadows. I assume that the shadows aren't drawn in the draw method. So where are they drawn and how can I transfer them to my canvas?
No, shadows are drawn for Views at a lower level than that. You're using the software rendering pipeline which does not support shadows.
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