KineticJS
KineticJS copied to clipboard
How to create image mask with png
Is it possible to create an image mask with a transparent png treating the transparent areas as not part of the "shape" to mask. Eg an alpha mask.
According to me, there are two solutions :
- drawHitFromCache Just cache your image and call drawHitFromCache.
- Do it yourself with hitFunc http://www.html5canvastutorials.com/kineticjs/html5-canvas-kineticjs-custom-hit-function-tutorial/ You just have to play with context and getImageData, putImageData