在ios上wx.canvasToTempFilePath生成图片不清晰

统一三倍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)
	}
})

这样导出的图片就会清晰很多了

你可能感兴趣的:(前端,javascript,vue.js)