【发布时间】:2017-08-03 09:11:20
【问题描述】:
我想插入这张图片
var img=new Image();
img.src="https://dl.dropboxusercontent.com/u/139992952/stackoverflow/desert1.jpg";
进入我正在用这个函数绘制的圆圈
function drawBall() {
//ctx.globalCompositeOperation='destination-in';
ctx.beginPath();
ctx.arc(x, y, ballRadius, 0, Math.PI*2);
ctx.drawImage(img,10,20);
ctx.globalCompositeOperation='source-over';
ctx.fillStyle = "#0095DD";
ctx.fill();
ctx.closePath();
}
这是画布当前的样子:
【问题讨论】:
-
虽然最终目标是相同的,但我不同意这些骗子 CV,因为在这里它似乎更像是对 gCO 工作原理的不理解(顺便说一句,这比欺骗。)