I'm following this tuto the which allow me to draw using the finger: http://marakana.com/tutorials/android/2d-graphics-example.html... I made some changes about drawing and other things... But now i Have to add a button the wich should save these canvas into a image jpg... How can I add the button at the canvas, and next save it?
Asked
Active
Viewed 3,777 times
-4
-
1possible duplicate of [Android canvas to jpg](http://stackoverflow.com/questions/2174875/android-canvas-to-jpg) – kabuko Apr 12 '13 at 20:14
-
Wasn't precisely the same post, thanks anyway, these answer can help me to save the canvas into a jpg image – Leonardo Sapuy Apr 12 '13 at 22:10
1 Answers
1
You cannot add a Button to your canvas. Create a layout XML file, add your custom view there and add the Button there too.

SimonSays
- 10,867
- 7
- 44
- 59
-
I'm just a Beginner, i don't know how to do it... Could you give some idea?, or just a little example?, thanks – Leonardo Sapuy Apr 12 '13 at 20:42
-
Please use the Android documentation. For custom Views see http://developer.android.com/training/custom-views/index.html and for XML layouts see http://developer.android.com/guide/topics/ui/declaring-layout.html – SimonSays Apr 12 '13 at 20:55
-
Thanks, I did what do you say, I had to create a layout the which include the button and next, in the onCreate method, I added the Canvas, adding layout parameters... – Leonardo Sapuy Apr 12 '13 at 21:54