html5使用canvas绘制文字特效
导读:收集整理的这篇文章主要介绍了html5使用canvas绘制文字特效,觉得挺不错的,现在分享给大家,也给大家做个参考。 @H_360_0@<canvas id="canvas" width="500" height="400"...
收集整理的这篇文章主要介绍了html5使用canvas绘制文字特效,觉得挺不错的,现在分享给大家,也给大家做个参考。 @H_360_0@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);
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: html5使用canvas绘制文字特效
本文地址: https://pptw.com/jishu/585374.html