Skip to content

Instantly share code, notes, and snippets.

@cfsilence
Created July 16, 2012 18:27
Show Gist options
  • Save cfsilence/3124147 to your computer and use it in GitHub Desktop.
Save cfsilence/3124147 to your computer and use it in GitHub Desktop.
laf-canvas-demo
<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