真机调试 Cannot read property 'getContext' of null ?
Cannot read property 'getContext' of null TypeError: Cannot read property 'getContext' of null 真机调试报错,模拟没问题,点按钮调用这个函数 function getCharacterMatrix(char, width, height, fontName, fontSize) {//01 点阵
const text = char;//输入的单字符
console.log('text:',text.length)
// 创建一个临时的Canvas对象
const canvas = wx.createOffscreenCanvas({type: '2d', width: fontSize, height: fontSize});
const ctx = canvas.getContext('2d');//这里真机 报错了
}