BeMyself1

 

canvas之绘制矩形

<!DOCTYPE html>
<html>
<head>
<title>canvas-1</title>
</head>
<body>
 <canvas id="c" width="200" height="200" style="border:1px solid #0066FF">
 </canvas>
 <script>
 var c=document.getElementById('c');
 var context=c.getContext("2d");
 context.fillStyle="#FF00CC";
 context.fillRect(50,50,100,100);
 </script>
</body>
</html>

posted on 2011-12-07 10:54  BeMyself1  阅读(158)  评论(0编辑  收藏  举报

导航