Created
February 17, 2014 05:33
-
-
Save anonymous/9045259 to your computer and use it in GitHub Desktop.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Canvas tutorial</title> | |
<script type="text/javascript"> | |
function draw(){ | |
var canvas = document.getElementById('canvas'); | |
if(canvas.getContext) | |
{ | |
var ctx = canvas.getContext('2d'); | |
ctx.beginPath(); | |
ctx.moveTo(75, 50); | |
ctx.lineTo(100, 75); | |
ctx.lineTo(100, 25); | |
ctx.fill(); | |
} | |
} | |
</script> | |
<style> | |
canvas { border: 1px solid black; } | |
</style> | |
</head> | |
<body onload="draw();"> | |
<canvas></canvas> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment