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);

 

posted @ 2021-02-10 22:06  newmiracle宇宙  阅读(159)  评论(0编辑  收藏  举报