mercredi 1 avril 2015

How to replaceByImage() instead of drawImage() on html canvas (ignore opacity)?

I would like to draw an image (which can have transparent parts) on the canvas, totally replacing the canvas content by the sourve image (unlike in a source-over composition operation).


The resulting canvas would have the exact same values as the source image. I can't find any composition operation to perform this.


I can always clear the canvas before calling drawImage() but I was wondering if there is a faster/better way.


Aucun commentaire:

Enregistrer un commentaire