31
rated 0 times
[
37]
[
6]
/ answers: 1 / hits: 64417
/ 14 Years ago, wed, august 11, 2010, 12:00:00
there's an example, which loads 2 images:
canvas = document.getElementById(canvas);
ctx = canvas.getContext(2d);
var img1 = new Image();
img.src = /path/to/image/img1.png;
img.onload = function() {
ctx.drawImage(img, 0, 0);
};
var img2 = new Image();
img2.src = /path/to/image/img2.png;
img2.onload = function() {
ctx.drawImage(img2, 100, 100);
};
I need to remove(replace) img2 from canvas. What is the best way to do it?
More From » html