Answers for "canvas rounded corners on image"

0

canvas rounded corners on image

ctx.save();
ctx.beginPath();
// use lineTo and BezierTo here to make the path you want, which is a rectangle the size of the image with two rounded corners.
ctx.closePath();
ctx.clip();

// draw the image using  ctx.drawImage(..
ctx.restore(); // so clipping path won't affect anything else drawn afterwards
Posted by: Guest on June-28-2021

Code answers related to "canvas rounded corners on image"

Code answers related to "Javascript"

Browse Popular Code Answers by Language