HTML canvas setTransform() Method

Example

Draw a rectangle, reset and create a new transformation matrix with setTransform(), draw
the rectangle again, reset and create a new transformation matrix, then draw the
rectangle again. Notice that each time you call setTransform(), it resets the
previous transformation matrix and then builds the new matrix, so in the example
below, the red rectangle is not shown, because it is under the blue rectangle:

Web Certificates

W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding.
Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content.
While using this site, you agree to have read and accepted our terms of use,
cookie and privacy policy.
Copyright 1999-2015 by Refsnes Data. All Rights Reserved.