tags:

views:

61

answers:

1

Hi everyone !!

I am able to draw a signature on my canvas. Now after that I want to save this signature as an image which can be used later.

I am unable to implement an onClicklistener on this canvas. Also I am unclear as to how this signature can be stored as an image. Please suggest?

A: 

Try this:

Bitmap bmp = Bitmap.createBitmap(...);
Canvas can = new Canvas(bmp);

When you change your canvas, bitmap bmp will change too. Canvas is only raference to Bitmap canvas, and you have no need to save canvas. Save only Bitmap (bmp).

Demand
But how do i save bitmap to an Sd-card ?
AceAbhi
I think you neend to use compress(Bitmap.CompressFormat format, int quality, OutputStream stream)
Demand
This method will write bitmap to outputStream. After that write this output stream to file on sd card.
Demand
http://stackoverflow.com/questions/649154/android-bitmap-save-to-location - see that
Demand