canvas完美实现刮刮卡的方法

canvas完美实现刮刮卡的方法

  var c=document.getElementById("myCanvas");
  var ctx=c.getContext("2d");


ctx.fillStyle="red";
ctx.fillRect(20,20,75,50);
ctx.globalCompositeOperation="xor";
ctx.fillStyle="blue";
ctx.fillRect(50,50,75,50);


如果遇到什么不懂的地方直接关注公众号留言(本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须在文章页面给出原文连接,否则保留追究法律责任的权利。)
作者:newmiracle
出处:https://www.cnblogs.com/newmiracle/

 
原文地址:https://www.cnblogs.com/newmiracle/p/14396790.html