save() and restore() are just used to save the state of the Canvas (translate, scale, etc.) It won't help you for what you want.
On Wed, Oct 7, 2009 at 12:26 AM, Samuh Varta <[email protected]> wrote: > I am playing with the FingerPaint application that comes bundled with the > API demos package. I was wondering if I could add an "Undo" feature to it, > which would allow the user to remove/undo his latest stroke drawing from the > canvas. I am not sure of how to achieve this though. > > I was looking at the android.graphics.Canvas class and therein I found a few > methods that caught my interest. > canvas.restore() and canvas.save(). But I couldn't get them to work per my > requirement. > > One of the approach could be memorizing all the Path(representing strokes > drawn) and then resetting the canvas and reapinting all the stroked one by > one except the latest. I somehow dont like this approach. > How do I undo my drawings on canvas? > Please help. > > Thanks. > > > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~----------~----~----~----~------~----~------~--~---

