You are on page 1of 1

<!

DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>canvas transform() Example</title> <style type="text/css"> canvas {border: 1px solid black;} </style> <script type="text/javascript"> window.onload = function(){ var canvas = document.getElementById("canvas"); var context = canvas.getContext("2d"); context.fillStyle = "rgba(255,0,0,.4)"; context.rect(0,0,100,100); context.fill(); context.setTransform(1,1,1,0,0,0); context.beginPath(); context.fillStyle = "rgba(0,255,0,.4)"; context.rect(75,75,100,100); context.fill(); context.setTransform(0,.5,1,.8,0,0); context.beginPath();

You might also like