wx.createSelectorQuery() .select('#mycanvas') .fields({ node: true, size: true, }) .exec(this.init.bind(this)) const width = res[0].width const height = res[0].height const canvas = res[0].node const ctx = canvas.getContext('2d') const dpr = wx.getSystemInfoSync().pixelRatio canvas.width = width*dpr canvas.height = height*dpr this.render(canvas, ctx) // ctx.scale(dpr, dpr) const img = canvas.createImage() img.onload = () => { this._img = img ctx.drawImage(this._img, 65, 130, 620, 400) ctx.restore() } img.src = this.data.houseInfo.POSTER_IMAGE
canvas在开发工具中能正常显示,但是在手机预览显示不出来,2.9.1版本导出图片接口编辑器也报?[图片] [图片] [图片] [图片] [图片] [图片]
2020-04-27