I am new to javascript. I am creating new images in my js file by saying
What I intend to is draw a new image and remove the previous one…
My code sample is :
var image = new Image();
image.src = 'abc.png';
ctx.drawImage(image, x, y,30,30);
and then I am using
ctx.clearRect(x, y, 30, 30);
but it does not clear the images drawn..
What should I do?
Thanks in advance
Check this HTML5 canvas tutorial for clear and redraw new image
Hope this can be helpful for you.