我正在尝试用图像文件替换下面的椭圆形状。
/* this is the image variable I'm trying to use to replace the shape*/
var img = new Image();
img.addEventListener('load', function(e) {
canvas.drawImage(this, 0, 0, 400, 400);
}, true);
img.src="img/crystal.png";
/* this is circle shape I'm trying to replace*/
stroke(0);
fill(175);
ellipse(xpos, ypos, 32, 32);
}