Beej's Bit Bucket
a day ago
- Created a scratch-off demo using HTML5 Canvas's globalCompositeOperation property.
- globalCompositeOperation controls how new drawings blend with existing canvas content; default mode is source-over.
- Firefox had issues with source-out mode, so source-atop was used as fallback.
- Alternative approach using clip() method is possible but likely slower.
- Code is demo only; remove thumbnails by deleting lines mentioning 'thumb'. Added page for multiple canvases.