Section 25.36. CanvasRenderingContext2D.scale( ): scale the user coordinate system of the canvas


25.36. CanvasRenderingContext2D.scale( ): scale the user coordinate system of the canvas

25.36.1. Synopsis

 void scale(float sx, float sy) 

25.36.1.1. Arguments

sx, sy

The horizontal and vertical scaling factors.

25.36.2. Description

scale( ) adds a scale transformation to the current transformation matrix of the canvas. Scaling is done with independent horizontal and vertical scaling factors. For example, passing the values 2.0 and 0.5 causes subsequently drawn paths to be twice as wide and half as high as they would otherwise have been. Specifying a negative value for sx causes X coordinates to be flipped across the Y axis, and a negative value of sy causes Y coordinates to be flipped across the X axis.

25.36.3. See Also

CanvasRenderingContext2D.rotate( ), 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