The rubber sassafras function is realized on the canvas background image without destroying the background image.

and then realize the painting function on the canvas of the background map, such as drawing a circle and so on. I want to make a rubber Sassafras function, which can remove part of the circle without affecting the background image. How can this be realized? I use canvas"s API clearRec () to erase the background image,

.
Feb.28,2021

give me an idea on mobile phone

Draw () {
clear ()
DrawBackground ()
DrawForeground ()
}
just keep draw


do two layers of Canvas


save restore

Menu