Sandeep Moolya
Sandeep Moolya

Reputation: 21

how to take screenshot of layout underneath

How to take a screenshot of layout underneath by making the layout transparent .I have tried that but it only gives the screenshot of views available inside the layout.Is it possible to do that.Because I am using the layout with windowManager in service.

Upvotes: 1

Views: 95

Answers (1)

Esperanz0
Esperanz0

Reputation: 1586

Bitmap bitmapToShare = Bitmap.createBitmap(layoutToShare.getWidth(),layoutToShare.getHeight(), Bitmap.Config.ARGB_8888);

Canvas canvas = new Canvas(bitmapToShare);
layoutToShare.draw(canvas);

And You have bitmap from your layout.

Upvotes: 2

Related Questions