canvas绘图怎么匹配多个手机型号 使用rpx
let canvas = wx.createCanvasContext(“shareCanvas”);
//绘制背景
canvas.drawImage(res[1].path, 0, 0, 301, 420);
canvas.save();
//绘制二维码
canvas.drawImage(res[0].path, 108, 262, 85, 85);
//绘制文字
canvas.font = “normal bold 20px sans-serif”;
canvas.fillStyle = “#fff”;
canvas.setTextAlign(“center”);
canvas.fillText(“您的好友“” + this.wechat + “””, 150, 40);
canvas.fillText(“送你20元红包”, 150, 65);
canvas.draw();