canvas基礎知識補齊一下,明白了原理便很簡單。canvas
//保存上文
targetCtx.save()
targetCtx.beginPath()
targetCtx.arc(110, 60, 30, 0, 2 * Math.PI) //繪製圓圈
targetCtx.clip() //裁剪
targetCtx.drawImage("/image/111.jpg",80,30,60,60) //定位在圓圈範圍內便會出現
targetCtx.restore()
//恢復上文內容,繪製其餘
targetCtx.draw();
複製代碼