Angusfz 2015-06-06 18:03
js+html5实现canvas绘制镂空字体文本的方法
<!DOCTYPE html> vS!%!-F
<html> &vDK6w,
<body> {hS9FdWA;
<canvas id="myCanvas" width="200" height="100" <6
LpsM}
style="border:1px solid #d3d3d3;"> )}
I>"n
Your browser does not support the HTML5 canvas tag.</canvas> O?6ph4'
<script type="text/javascript"> Zj(2$9IU
var c=document.getElementById("myCanvas"); ^7qqO%
var ctx=c.getContext("2d"); Kzj9!'0R
ctx.font="30px Arial"; d".Xp4}f
ctx.strokeText("Hello World",10,50); tX<.
Ud
</script> TVkC pO,H
</body> 7a,/DI2o
</html> &jg..R