Skip to content
Advertisement

Canvas clip image with two quadraticCurves

I just wanted to clip image in a curve .. but not happening this.. Only image is showing and but not with clip.

JavaScript
JavaScript

Advertisement

Answer

You have to move everything from the line context.save(); to context.clip(); inside the function object of your imgObj‘s onload handler:

JavaScript

See http://jsfiddle.net/CSkP6/1/ for an example.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement