scale method
[This documentation is preliminary and is subject to change.]
Scales the current context by the specified horizontal (x) and vertical (y) factors.
![]() ![]() |
Syntax
HRESULT retVal = object.scale(x, y);
Standards information
- HTML Canvas 2D Context, Section 3
Parameters
x [in]
Type: floatThe horizontal scaling factor, where
1equals unity or 100% scale.y [in]
Type: floatThe vertical scaling factor.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
When you create a CanvasRenderingContext2D object, it has a transformation matrix that identifies the current state. The 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.
Build date: 1/23/2012
.png)
.png)