tags:

views:

308

answers:

2

I know what it does. If I dont use sometimes I can see the difference in alignments, sometimes I dont. My question is if canvas.restore restores the state previous to when it was saved. Why arent the changes made after save and before restore undone ? The changes remain same. Why ?

+1  A: 

canvas.save and canvas.restore undo things like rotation and translation. They don't undo drawing on the canvas. The android canvas works similarly to the HTML5 canvas, so you can look at https://developer.mozilla.org/en/Canvas_tutorial/Transformations if you need more clarification.

Ben L.
Thanks for the link man..
Prabhat
A: 

So, if I only use .drawARGB to clear the canvas, then lots of .drawText and .drawBitmap methods of the canvas object to display things, do I need to do any save/restore actions?

FrinkTheBrave