Created
December 20, 2011 00:35
-
-
Save dennisschaaf/1499612 to your computer and use it in GitHub Desktop.
Simple Canvas Example
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
<html> | |
<head> | |
<title>Canvas Tutorial</title> | |
<script type="text/javascript" src="http://static.dennisschaaf.com/hand-canvas-pre-release.js"></script> | |
<script type="text/javascript"> | |
var canvas; // The Canvas | |
var ctx; // The Context | |
function draw(){ | |
canvas = document.getElementById('tutorial'); // Get the canvas | |
ctx = canvas.getContext('2d'); // Get the drawing context | |
ctx = handCanvas(ctx); // Convert the context into a hand canvas | |
} | |
</script> | |
</head> | |
<body onload="draw();"> | |
<canvas id="tutorial" width="500" height="500"></canvas> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment