统一三倍canvas画图,然后正常导出
canvas.width = canvasWidth*3;
canvas.height = canvasHeight*3;
ctx.drawImage(image, 0, 0, canvasWidth*3, canvasHeight*3);
wx.canvasToTempFilePath({
width: canvasWidth*3,
height: canvasHeight*3,
destWidth: canvasWidth,
destHeight: canvasHeight,
canvas: canvas,
success(res) {
resolve(res.tempFilePath);
},
fail(error) {
reject(error)
}
})
这样导出的图片就会清晰很多了