mozilla
您的搜索结果

    Canvas指南:形状绘图

     

    <!DOCTYPE HTML>
    <html>
     <head>
      <script type="application/x-javascript">
        function draw() {
          var canvas = document.getElementById("canvas");
          var cxt=canvas.getContext("2d");
    cxt.fillStyle="#FF0000";
    cxt.beginPath();
    cxt.moveTo(10,10);
    cxt.lineTo(150,50);
     
    cxt.lineTo(10,50);
     
    cxt.lineTo(10,10);
     
    cxt.stroke();
    cxt.closePath();
    cxt.fill();
        }
      </script>
     </head>
     <body onload="draw();">
       <canvas id="canvas" width="150" height="150">
         <p>This example requires a browser that supports the
         <a href="http://www.w3.org/html/wg/html5/">HTML5</a> 
         &lt;canvas&gt; feature.</p>
       </canvas>
     </body>
    </html>

    文档标签和贡献者

    Contributors to this page: davelet, jinbeijian
    最后编辑者: jinbeijian,