Draw Inflated Layout Xml On An Bitmap
I created a layout xml file that contains an extended textview. What I want is to draw the textview in a bitmap. What do I have to do after inflating the view so that I can use the
Solution 1:
Below are the steps to perform what you want:
- You have to create a mutable Bitmap (with the size of the screen).
- Create a Canvas from that Bitmap.
- inflate your view, get a reference to it.
- Call your_view.draw(your_canvas).
That's all, in your Bitmap you will have your view and all of it children drawn.
Post a Comment for "Draw Inflated Layout Xml On An Bitmap"