source: trunk/examples/script/context2d/scripts/quad.js@ 266

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

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

File size: 565 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
11 ctx.beginPath();
12 ctx.moveTo(75,25);
13 ctx.quadraticCurveTo(25,25,25,62.5);
14 ctx.quadraticCurveTo(25,100,50,100);
15 ctx.quadraticCurveTo(50,120,30,125);
16 ctx.quadraticCurveTo(60,120,65,100);
17 ctx.quadraticCurveTo(125,100,125,62.5);
18 ctx.quadraticCurveTo(125,25,75,25);
19 ctx.stroke();
20
21 }
Note: See TracBrowser for help on using the repository browser.