source: trunk/examples/script/context2d/scripts/alpha.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: 530 bytes
Line 
1var ctx = document.getElementById('tutorial').getContext('2d');
2 // draw background
3 ctx.fillStyle = '#FD0';
4 ctx.fillRect(0,0,75,75);
5 ctx.fillStyle = '#6C0';
6 ctx.fillRect(75,0,75,75);
7 ctx.fillStyle = '#09F';
8 ctx.fillRect(0,75,75,75);
9 ctx.fillStyle = '#F30';
10 ctx.fillRect(75,75,75,75);
11 ctx.fillStyle = '#FFF';
12
13 // set transparency value
14 ctx.globalAlpha = 0.2;
15
16 // Draw semi transparent circles
17 for (i=0;i<7;i++){
18 ctx.beginPath();
19 ctx.arc(75,75,10+10*i,0,Math.PI*2,true);
20 ctx.fill();
21 }
Note: See TracBrowser for help on using the repository browser.