wx.canvasGetImageData({
canvasId: "shopCanvas",
x: 0,
y: 0,
width: width,
height: height,
success(res) {
console.log("canvas:图片",res.data);
let pngData = upng.encode([res.data.buffer], res.width, res.height)
let base64 = wx.arrayBufferToBase64(pngData);
imgBase64 = 'data:image/png;base64,' + base64;
}
})
我测试res.data.buffer返回为空,你问题解决了吗