Once the contents of a canvas element have been drawn using the 2d context drawing methods or image loading methods you can start using transformation methods to manipulate the drawing state.
To keep track of drawing states you use the canvas 2d context’s save() and restore() methods.
The save() method pushes a copy of the current drawing state onto the drawing state stack. This stack is simply a storage pile of canvas drawing states that can be returned to by successively calling the restore() method.
(more…)
Tags: Canvas, html5, image, transform