source:
trunk/examples/script/context2d/scripts/moveto2.js@
519
Last change on this file since 519 was 2, checked in by , 16 years ago | |
---|---|
File size: 528 bytes |
Line | |
---|---|
1 | var canvas = document.getElementById('tutorial'); |
2 | |
3 | // Make sure we don't execute when canvas isn't supported |
4 | if (canvas.getContext){ |
5 | |
6 | // use getContext to use the canvas for drawing |
7 | var ctx = canvas.getContext('2d'); |
8 | |
9 | // Filled triangle |
10 | ctx.beginPath(); |
11 | ctx.moveTo(25,25); |
12 | ctx.lineTo(105,25); |
13 | ctx.lineTo(25,105); |
14 | ctx.fill(); |
15 | |