Thanks!
After experiementing, seems to work. I think all I need to do is to do
the view.draw(canvas) prior to have the canvas filled with what's
drawn on screen. I am still exactly sure what's happening though, as
basically I just do everything as it is, and create a new bitmap and a
new canvas
Hi,
That is why I gave you a complete working example ( maybe try it
yourself ). But not knowing your code I could only guess about when
you would want to call the saveView() method I provided.
I guess that you would call the saveView() method when the user
requests that your KidsPaintView view
Hi,
I made up the following to demonstrate what I meant.
In this example when you press the trackball/dpad center button the
view is written to a png file and also set as the wallpaper.
You can change it to save as jpeg file etc.
Hope that helps.
Regards
Thanks!
I think the part that I am confused is that I never used view.draw
(canvas) code in my program so I don't know when to call it... at this
moment, says I wanted to clear a screen, this is my code in the view:
public void clearScreen() {
gradient = false;
dots.clear();
Hi,
Have a look at -
http://developer.android.com/reference/android/view/View.html#draw(android.graphics.Canvas)
- create a new bitmap and a new canvas, associate the bitmap with this
canvas and call view.draw( your_new_canvas ) - using your
KidsPaintView view instance - then save the bitmap
5 matches
Mail list logo