首页 > 其他 > 详细

canvas光晕

时间:2015-08-27 21:06:03      阅读:930      评论:0      收藏:0      [点我收藏+]

技术分享

 

 1 <!DOCTYPE html>
 2 <html>
 3     <head>
 4         <meta charset="utf-8">
 5         <title></title>
 6         <script type="text/javascript">
 7             function draw(id){
 8                 var convas = document.getElementById(id);
 9                 if(canvas == null){
10                     return false;
11                 }
12                 var context = canvas.getContext(2d);
13                 context.fillStyle = #eeeeff;
14                 context.fillRect(0,0,400,300);
15                 for(var i=0;i<10;i++){
16                     context.beginPath();
17                     context.arc(i*25,i*25,i*10,0,Math.PI*2,true);
18                     context.closePath();
19                     context.fillStyle = rgba(255,0,0,0.25);
20                     context.fill();
21                 }
22             }
23         </script>
24     </head>
25     <body onload="draw(‘canvas‘);">
26         <canvas id="canvas" width="400" height="300"></canvas>
27     </body>
28 </html>

 

canvas光晕

原文:http://www.cnblogs.com/staven/p/4764216.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!