📅  最后修改于: 2022-03-11 15:04:23.658000             🧑  作者: Mango
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