Is it possible to use clearRect to delete part of a png image drawn to the canvas using drawImage?
I'm trying something like this and its not working:
<canvas id="canvas"></canvas>
<img id="pngimg" src="" alt="" />
[...]
canvas = document.getElementById("canvas");
pngimg = document.getElementById("pngimg");
[...]
pngimg.src = canvas.toDataURL();
context.drawImage(pngimg, 0, 0, canvas.width, canvas.height);
[...]
Then using clearRect to erase with the mouse. The erase works on the strokes that were added to the canvas using drawLine but not for images using drawImage. It must be clearRect instead of drawing a solid color because the background isn't solid. Is it possible to do this?