【反馈bug】canvas 剪切图片bug

发布于 8 年前作者 xiongmin4075 次浏览最后编辑 8 年前来自 ask

用canvas 将图片剪切成圆形,在工具预览显示为方形,手机上显示正常

ctx.save();

ctx.beginPath()

ctx.arc(50, 50, 25, 0, 2 * Math.PI);

ctx.setStrokeStyle(‘#ffffff’)

ctx.clip();

ctx.drawImage(res[0].path, 25, 25, 50, 50);

ctx.stroke();

ctx.closePath();

ctx.restore();

1 回复
leihuang
leihuang1 楼6 年前

我也遇到了,纠结了半天。看到你说的真机上正常,果断去试了下,确实真机可以,那就先这样了