&l;cavaid=&quo;cava&quo;widh=&quo;500&quo;heigh=&quo;400&quo;yle=&quo;backgoud-colo:yellow;&quo;&g;&l;/cava&g;復制代碼代碼如下:vacava=docume.geElemeById(&quo;cava&quo;);vacx=cava.geCoex(&quo;2d&q......
以下是【金聰采編】分享的內容全文:
以下是【金聰采編】分享的內容全文:
<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 黑體";
//繪制實心字
cxt.fillStyle="red";//填充紅色
cxt.fillText("hello,思思博士",10,50);
//繪制空心字
cxt.strokeStyle="red";//紅色邊
cxt.strokeText("hello,思思博士",10,100);


侵權舉報/版權申訴



