Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Scales the current context by the specified horizontal (x) and vertical (y) factors.
![]() ![]() |
Syntax
object.scale(x, y);
Parameters
x [in]
Type: numberThe horizontal scaling factor, where
1equals unity or 100% scale.y [in]
Type: numberThe vertical scaling factor.
Return value
This method does not return a value.
Standards information
- HTML Canvas 2D Context, Section 3
Remarks
When you create a CanvasRenderingContext2D object, it has a transformation matrix that identifies the current state. The ICanvasRenderingContext2D::scale method modifies the transformation by multiplying the matrix by the specified factor. For example, context.scale(1,.5) halves the vertical (or y-axis) values that are used in context and leaves the horizontal (or x-axis) values the same. Similarly, context.scale(2,2) doubles the size of the graphics.
.png)
.png)