Getting started
Images
Path syntax
Media types and the canvas
Animation
Collisions and intersections
Paths
Text
Clearing the screen
Navigating along a path
Dragging path shapes images
Shadows
Charts diagrams
Polygons
Transformations
Responsive design
Compositing
Pixel manipulation
Contributors

Erase existing shapes with "destination-out"

suggest change
context.globalCompositeOperation = "destination-out";

“destination-out” compositing uses new shapes to erase existing drawings.

The new shape is not actually drawn – it is just used as a “cookie-cutter” to erase existing pixels.

context.drawImage(apple,0,0);
context.globalCompositeOperation = 'destination-out';   // bitemark erases
context.drawImage(bitemark,100,40);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents