tags:

views:

196

answers:

2

Hi, 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 draw method on the my canvas?

Thanks

+2  A: 

Hello,

Below are the steps to perform what you want:

  1. You have to create a mutable Bitmap (with the size of the screen).
  2. Create a Canvas from that Bitmap.
  3. inflate your view, get a reference to it.
  4. Call your_view.draw(your_canvas).

That's all, in your Bitmap you will have your view and all of it children drawn.

Lucas S.
Thanks, I was doing the same think, but the drawing failed because my extended textview was doing something wrong.
Tughi
A: 

can u plz send me the code at [email protected]

jasra