📜  图像上的画布圆角 - Javascript代码示例

📅  最后修改于: 2022-03-11 15:04:23.658000             🧑  作者: Mango

代码示例1
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