Prev Demo
Transform()
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Transform</title> </head> <body> <canvas id="myCanvas" width="300" height="200" style="border:3px dotted silver;"> Your browser does not support the HTML5 canvas tag. </canvas> <script> var a = document.getElementById("myCanvas"); var b = a.getContext("2d"); b.fillStyle = "orange"; b.fillRect(0, 0, 250, 10) b.transform(1, 0.5, -0.5, 1, 3, 1); b.fillStyle = "silver"; b.fillRect(0, 0, 250, 10); b.transform(1, 0.5, 0, 1, 0, 10); b.fillStyle = "green"; b.fillRect(0, 0, 250, 10); </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output