Section 25.35. CanvasRenderingContext2D.save( ): save a copy of the current graphics state


25.35. CanvasRenderingContext2D.save( ): save a copy of the current graphics state

25.35.1. Synopsis

 void save( ) 

25.35.2. Description

save( ) pushes a copy of the current graphics state onto a stack of saved graphics states. This allows you to temporarily change the graphics state, and then restore the previous values with a call to restore( ).

The graphics state of a canvas includes all the properties of the CanvasRenderingContext2D object (except for the read-only canvas property). It also includes the transformation matrix that is the result of calls to rotate( ), scale( ), and TRanslate( ). Additionally, it includes the clipping path, which is specified with the clip( ) method. Note, however, that the current path and current position are not part of the graphics state and are not saved by this method.

25.35.3. Bugs

Firefox 1.5 does not save and restore the strokeStyle property.

25.35.4. See Also

CanvasRenderingContext2D.restore( )




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net