let bgUrl = ''
// canvas绘制网络图片需保存至本地
wx.getImageInfo({
src: '',//服务器返回的图片地址
success: function (res) {
console.log(res);
bgUrl = res.Path
},
fail: function (res) {
console.log(res);
}
});
ctx.drawImage(bgUrl, 0, 0, wigth, height);
网友回复
黑夜白昼1999: