使用安卓手机并不报错!只有运行苹果手机会进程崩溃!
uni.canvasGetImageData({
canvasId: 'test', //test l-painterText
x: 0,
y: 0,
width: 576,
height: 448,
success: function(res) {
console.log(res)
const diff = Date.now() - uni.getStorageSync('time') // 时间差
console.log("获取画布数据成功" + (diff / 1000) + "秒")
printerRef.printBitMap(res);
},
complete: function(res) {
console.log("finish")
},
fail: function(res) {
console.log(res)
}
})