source: trunk/examples/script/context2d/scripts/moveto.js@ 5

Last change on this file since 5 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

File size: 575 bytes
Line 
1var 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 // Draw shapes
10 ctx.beginPath();
11 ctx.arc(75,75,50,0,Math.PI*2,true); // Outer circle
12 ctx.moveTo(110,75);
13 ctx.arc(75,75,35,0,Math.PI,false); // Mouth
14 ctx.moveTo(65,65);
15 ctx.arc(60,65,5,0,Math.PI*2,true); // Left eye
16 ctx.moveTo(95,65);
17 ctx.arc(90,65,5,0,Math.PI*2,true); // Right eye
18 ctx.stroke();
19
20 }
Note: See TracBrowser for help on using the repository browser.