Using javascript, I drew some polygonal images on my canvas.
I would like, based on user events / clicks, to be able to clear a section of the canvas (one of these polygon images), which is irregular in shape and not a rectangle.
So, I cannot use clearRect () for my purpose.
Can anyone think of how I can do this?
Essentially, I would like to make part of my canvas transparent, but this is not a rectangular shape ... As soon as I have a region defined with which I can fill () and stroke (), can I also clear () it ... I know that such a function is not available. What do people do to clean irregularly shaped sections ?
I'm a little new to this, so apologize in advance if this sounds like a dumb question.
source
share