1

Is it possible to go back after I use drawImage?

Example:

I draw an image and them overdraw another. I want to delete the first image and, on the clear surface, draw a new image.

Is it possible?

4

1 回答 1

1

如果要撤消 drawImage 更改,则必须在执行 drawImage 之前保存画布数据,例如:

tmp = canvas.getContext("2d").getImageData(0, 0, with, height);
//do changes here
canvas.getContext("2d").putImageData(tmp , 0, 0);
//here changes will be lost

这是对标题的回答,问题内容对我来说不清楚

于 2013-08-20T19:22:33.797 回答