This JSFiddle is what I am working on.
From the code you can see that the Pug and Google images are clipped by clipRect
. (Please note that my code is FabricJs, not just normal Canvas)
Now, I want to adapt that by changing the clipping region from Rectangle shape to star shape for example. So, it is too difficult to use context.beginPath();
right?, then how can I achieve that without drawing Path ? Is there a way to make star image to become clipping region ?
In addition, my goal is similar to this website. The website is about designing a mobile's case. I would very appreciate if you explain how the clipping in this website work (No advertising). To see my point, try upload an image and put it to the top-left block, your image will be clipped perfectly to the case.
You can update my JSFiddle for better example.