是用canvastotempfile函数导出图片显示的,等下个版本吗?
ios版本号13.7.0 拍照第一次照片变形,第二次拍照就正常了?其他机型无任何问题 [图片]
2020-09-28我也不太理解,之后我图片和文字加上的时候就变形了
画布canvas组件官方示例为什么要乘以设备像素比?canvas组件下,有一段示例代码,如下: <!-- canvas.wxml --> <canvas type="2d" id="myCanvas"></canvas> // canvas.js Page({ onReady() { const query = wx.createSelectorQuery() query.select('#myCanvas') .fields({ node: true, size: true }) .exec((res) => { const canvas = res[0].node const ctx = canvas.getContext('2d') const dpr = wx.getSystemInfoSync().pixelRatio canvas.width = res[0].width * dpr canvas.height = res[0].height * dpr ctx.scale(dpr, dpr) ctx.fillRect(0, 0, 100, 100) }) } }) 不太理解长宽为什么要乘以dpr,并且画布缩放同样的倍数。我把这些去掉后预览看起来和上面一样: canvas.width = res[0].width canvas.height = res[0].height // ctx.scale(dpr, dpr)
2020-09-24你看下你的基础库的版本是否高于2.9.0
插件开发时,不支持canvas 2d?[图片] [图片]
2020-09-24我也是这个问题,请问你解决了吗?
真机调试错误,这是什么情况?怎么定位问题?VM21:2 (in promise) MiniProgramError Cannot read property 'createView' of undefined TypeError: Cannot read property 'createView' of undefined at n.value (eval at n.call.document (http://127.0.0.1:51844/remote-debug/runtime.js?devtools_ignore=true:1:11339), <anonymous>:2:1064980) at n.value (eval at n.call.document (http://127.0.0.1:51844/remote-debug/runtime.js?devtools_ignore=true:1:11339), <anonymous>:2:757375) at t (eval at n.call.document (http://127.0.0.1:51844/remote-debug/runtime.js?devtools_ignore=true:1:11339), <anonymous>:2:757542) at n.value (eval at n.call.document (http://127.0.0.1:51844/remote-debug/runtime.js?devtools_ignore=true:1:11339), <anonymous>:2:757631) at eval (eval at n.call.document (http://127.0.0.1:51844/remote-debug/runtime.js?devtools_ignore=true:1:11339), <anonymous>:2:1300784) at new Promise (<anonymous>) at pu (eval at n.call.document (http://127.0.0.1:51844/remote-debug/runtime.js?devtools_ignore=true:1:11339), <anonymous>:2:1300746) at eval (eval at n.call.document (http://127.0.0.1:51844/remote-debug/runtime.js?devtools_ignore=true:1:11339), <anonymous>:2:1302216) at Array.forEach (<anonymous>) at r (eval at n.call.document (http://127.0.0.1:51844/remote-debug/runtime.js?devtools_ignore=true:1:11339), <anonymous>:2:1302194)
2020-09-19