Ava
Ava

Reputation: 2132

Draw elevation shadows to canvas

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?

Upvotes: 16

Views: 2126

Answers (1)

Chris Banes
Chris Banes

Reputation: 31871

No, shadows are drawn for Views at a lower level than that. You're using the software rendering pipeline which does not support shadows.

Upvotes: 8

Related Questions