Section 25.34. CanvasRenderingContext2D.rotate( ): rotate the coordinate system of the canvas


25.34. CanvasRenderingContext2D.rotate( ): rotate the coordinate system of the canvas

25.34.1. Synopsis

 void rotate(float angle) 

25.34.1.1. Arguments

angle

The amount of rotation, in radians. Positive values result in clockwise rotation, and negative values result in counterclockwise rotation.

25.34.2. Description

This method alters the mapping between canvas coordinates and the pixels of the <canvas> element in the web browser so that any subsequent drawing appears rotated within the canvas by the specified angle. It does not rotate the <canvas> element itself. Note that the angle is specified in radians. To convert degrees to radians, multiply by Math.PI and divide by 180.

25.34.3. See Also

CanvasRenderingContext2D.scale( ), CanvasRenderingContext2D.translate( )




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