const ctx = wx.createCanvasContext('myCanvas')
wx.downloadFile({
url: 'http://is5.mzstatic.com/image/thumb/Purple128/v4/75/3b/90/753b907c-b7fb-5877-215a-759bd73691a4/source/50x50bb.jpg',
success: function(res) {
ctx.save()
ctx.beginPath()
ctx.arc(50, 50, 25, 0, 2*Math.PI)
ctx.clip()
ctx.drawImage(res.tempFilePath, 25, 25)
ctx.restore()
ctx.draw()
}
})
用官方推荐的这个方法绘制多个圆形头像时,只能绘制两个,第三个出不来?求解
给楼主安利一波
https://github.com/AfanSama/esay-canvas