/

HTML / CSS / JavaScript Tutorial

JavaScript canvas2d object method: setTransform()

[this page | pdf | back links]

The setTransform() method of the JavaScript DOM object returned by the getContext("2d") method applied to the HTML <canvas> element defines a transform matrix and then applies the transform() method.

 

It has the following syntax with the following parameters:

 

context.setTransform(x1,x2,x3,x4, x5, x6)

 

Parameter

Required / Optional

Description

x1

Required

Horizontal scaling

x2

Required

Horizontal skew

x3

Required

Vertical skew

x4

Required

Vertical scaling

x5

Required

Horizontal moving

x6

Required

Vertical moving

 


NAVIGATION LINKS
Contents | Prev | Next | JavaScript DOM (and BOM)


Desktop view | Switch to Mobile