html5使用canvas绘制文字特效
摘要:代码如下:varcanvas=document.getElementById("canvas");varcxt=canvas.getCont...
<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);
【html5使用canvas绘制文字特效】相关文章:
★ html5 Canvas画图教程(11)—使用lineTo/arc/bezierCurveTo画椭圆形
★ html5的canvas元素使用方法介绍(画矩形、画折线、圆形)
上一篇:
html5使用canvas绘制太阳系效果
下一篇:
24个canvas基础知识小结
相关阅读
网友关注
网友最新关注视频
精品推荐
分类导航