03_DrawRectangle.html
Dosyayı İndir
<!DOCTYPE html>
<html>
<body>
<canvas id="mycanvas" width="300" height="240" style="border: 1px solid blue">
</canvas>
<script>
var mycanvas = document.getElementById('mycanvas');
var mycontext=mycanvas.getContext("2d");
mycontext.lineWidth = 5;
mycontext.strokeStyle = "#FF0000";
mycontext.strokeRect(60,30,50,50);
mycontext.fillStyle = "#00FF00";
mycontext.fillRect(120,90,50,50);
mycontext.strokeStyle = "#FF0000";
mycontext.strokeRect(180,150,50,50);
mycontext.fillStyle = "#00FF00";
mycontext.fillRect(180,150,50,50);
</script>
</body>
</html>
Dosyayı İndir