Mozilla's getting a new look. What do you think? https://mzl.la/brandsurvey

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>

文档标签和贡献者

 此页面的贡献者: jinbeijian, davelet
 最后编辑者: jinbeijian,