JavaScript canvas object method: restore()
[this page | pdf | back links]
The restore() method of the JavaScript
DOM object
corresponding to a context applied to the HTML <canvas>
element returns the context’s previously saved drawing state and attributes. Context
states are stored on a stack every time the save()
method is called, and returned whenever the restore()
method is called. The restore()
method takes no parameters.
For contexts generated by
getContext("2d"), the state
characteristics that are saved or restored appear to include:
-
The current transformation matrix and clipping region
-
The current values of the “Styles etc.”, “Line styles”, “Text” and “Other”
properties of the context, see here
The current path is not
part of the drawing state (it can only be reset using the beginPath
method). Neither is the bitmap that has been drawn (it is a property of the
canvas itself, not the context).
NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)