<address id="ousso"></address>
<form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
  1. html5使用canvas畫三角形

    時間:2025-08-04 18:11:44 網頁設計

    html5使用canvas畫三角形

      html5如何使用canvas畫三角形,就跟隨百分網小編一起去了解下吧,想了解更多相關信息請持續關注我們應屆畢業生考試網!

      <canvas id="canvas" width="500" height="500" style="background-color: yellow;"></canvas>

      代碼如下:

      var canvas=document.getElementById("canvas");

      var cxt=canvas.getContext("2d");

      cxt.beginPath();

      cxt.moveTo(250,50);

      cxt.lineTo(200,200);

      cxt.lineTo(300,300);

      cxt.closePath();/pic/p>

      /pic/p>

      cxt.strokeStyle="red";

      cxt.stroke();

      /pic/p>

      cxt.beginPath();

      cxt.moveTo(350,50);

      cxt.lineTo(300,200);

      cxt.lineTo(400,300);

      cxt.closePath();

      cxt.fill();

      <canvas id="canvas" width="500" height="400" style="background-color: yellow;"></canvas>

      代碼如下:

      var canvas=document.getElementById("canvas");

      var cxt=canvas.getContext("2d");

      cxt.font="40px 黑體";

      /pic/p>

      cxt.fillStyle="red";/pic/p>

      cxt.fillText("hello,思思博士",10,50);

      /pic/p>

      cxt.strokeStyle="red";/pic/p>

      cxt.strokeText("hello,思思博士",10,100);

    【html5使用canvas畫三角形】相關文章:

    html5的canvas方法使用01-19

    HTML5中Canvas的事件處理介紹02-06

    HTML5中canvas標簽實現刮刮卡效果10-29

    基于html5 canvas實現漫天飛雪效果的方法01-15

    HTML5的Audio標簽使用詳解02-19

    php使用html5實現多文件上傳實例02-27

    html5中的input新屬性range使用記錄12-14

    HTML5中你如何使用CSS建立不可選的文字12-14

    24個canvas基礎知識小結03-08

    <address id="ousso"></address>
    <form id="ousso"><track id="ousso"><big id="ousso"></big></track></form>
    1. 日日做夜狠狠爱欧美黑人