使用 <canvas type="2d" id="canvas"></canvas> 创建的canvas上下文
wx.createSelectorQuery()
.select('#canvas')
.fields({
node: true,
size: true
})
.exec(this.init.bind(this));
绘制字体时无法设置字体大小,颜色,使用ctx.setFillStyle与ctx.setTextAlign这类方法会报错
ctx.font = 'normal bold 52px sans-serif' ctx.fillStyle="#ae1208"; ctx.fillText('文字内容1',270,450); ctx.fillText('文字内容2',148,520);