Awais Tariq
Awais Tariq

Reputation: 7754

Save Canvas Drawing on Image in Android

I'm working on an application in which I'v a custom ImageView. Using custom imageview I can drag,zoom, and paste text over over it (using its onDraw() function). Now at the end I want to put all the canvas drawing over image and want to save it in the file system. I have tried imageView.getDrawingCache() method but it does not fulfill my requirements as when I zoom out the it captures black sides of the image too. Any suggestions?

Upvotes: 0

Views: 2170

Answers (1)

Pointer Null
Pointer Null

Reputation: 40370

  1. Create or load your Bitmap.
  2. Create Canvas.
  3. Set the Bitmap as target for this canvas. link
  4. Draw your text using the canvas.

Now your image stored in Bitmap has drawn stuff on top of it.

Upvotes: 1

Related Questions