好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

html5使用canvas绘制文字特效

<canvas id="canvas" width="500" h ei ght="400" style="background-color: yellow;"></canvas>
&nbs p;

复制代码

代码如下:


VAR canvas=document.getElementById("canvas");
var cxt=canvas.getContext("2d");
cxt.font="40px 黑体";
// 绘制 实心字
cxt.fillStyle=" red ";//填充 红色
cxt.fillText("hello,思思博士",10,50);
//绘制空心字
cxt. stroke Style="red";//红色边
cxt.strokeText("hello,思思博士",10,100);

总结

以上是 为你收集整理的 html5使用canvas绘制文字特效 全部内容,希望文章能够帮你解决 html5使用canvas绘制文字特效 所遇到的问题。

如果觉得 网站内容还不错, 推荐好友。

查看更多关于html5使用canvas绘制文字特效的详细内容...

  阅读:30次