Canvas transform() Method

Watch a demo of different values of the transform() method.

Or click a specific value to see the result:

transform(0.1,0,0,1,0,0);
transform(0.2,0,0,1,0,0);
transform(0.4,0,0,1,0,0);
transform(1,0,0,1,0,0);
transform(1.2,0,0,1,0,0);
transform(1.4,0,0,1,0,0);
transform(2,0,0,1,0,0);
your browser does not support the canvas tag
your browser does not support the canvas tag
your browser does not support the canvas tag
your browser does not support the canvas tag
your browser does not support the canvas tag
your browser does not support the canvas tag
your browser does not support the canvas tag
let c = document.getElementById('myCanvas');
let ctx = c.getContext('2d');
ctx.transform(0.1,0,0,1,0,0);
ctx.fillStyle='lightblue';
ctx.fillRect(20,20,250,100);
ctx.fillStyle='red';
ctx.font='30px Arial';
ctx.fillText('Transform', 60,80);

Play more with the code in our Tryit yourself editor: Try it Yourself ❯