html5使用canvas绘制文字特效
发布时间:2015-05-12 来源:查字典编辑
摘要:代码如下: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);
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
- win10系统怎么清理qq缓存文件 win10清理qq缓存文件的方法
- 详解windows系统的超酷技巧! windows技巧图文教程
- Win10系统如何删除补丁?Win10删除系统补丁的方法
- Win7如何关闭HIPS工具?Win7关闭HIPS工具的方法
- Win10如何查询ip地址?Win10查询ip地址的方法
- Win10系统如何利用360压缩软件解决打不开RAR压缩包的问题
- Win10操作中心设置添加/删除快速操作按钮方法图解
- Win7系统安装程序时提示mom.exe net framework初始化错误的原因及解决方法
- Win8系统电脑点击宽带连接时出现错误629的多种解决方法
- 如何解决Win7系统音箱和耳机分别使用不同音量的方法
最新HTML5教程学习