- 注册时间
- 2014-8-11
- 最后登录
- 2015-6-15
- 阅读权限
- 30
- 积分
- 225
- 精华
- 0
- 帖子
- 53
|
我想实现图片擦除的功能,就是鼠标拖过的地方都变成透明的,类似于以下的样子
我看到这些都是直接操作canvas实现的,主要代码如下:- function resetEraser(_x,_y,touch)
- {
-
- var t=this;
-
- t.cxt.globalCompositeOperation = "destination-out";
- t.cxt.beginPath();
- t.cxt.arc(_x, _y, t.eraserRadius, 0, Math.PI * 2);
-
- t.cxt.strokeStyle = "rgba(250,250,250,0)";//使用颜色值为白色,透明为0的颜色填充
- t.cxt.fill();
- t.cxt.globalCompositeOperation = "source-over"
- }
复制代码 这个功能不知道在lufylegend中如何实现?
|
|