Created
July 16, 2012 18:27
-
-
Save cfsilence/3124147 to your computer and use it in GitHub Desktop.
laf-canvas-demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function drawShape(){ | |
var canvas = document.getElementById('tutorial'); | |
if (canvas.getContext) { | |
var ctx = canvas.getContext('2d'); | |
// Draw shapes | |
ctx.fillRect(25, 25, 100, 100); | |
ctx.clearRect(45, 45, 60, 60); | |
ctx.strokeRect(50, 50, 50, 50); | |
} | |
else { | |
alert('Canvas not supported.'); | |
} | |
} | |
</script> | |
<canvas id="tutorial" width="150" height="150"></canvas> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment