- ctx.drawImage 空白?
CanvasRenderingContext2D 的 drawImage 方法 2.10.0 起支持传入通过 SelectorQuery 获取的 video 对象机型:iphone 13 系统:15.5基础库版本:2.25.2 draw() { const dpr = wx.getSystemInfoSync().pixelRatio wx.createSelectorQuery().select('#video').context(res => { console.log('select video', res) const video = this.video = res.context wx.createSelectorQuery().selectAll('#cvs1').node(res => { console.log('select canvas', res) let ctx1; if (res[0].node) { ctx1 = res[0].node.getContext('2d') res[0].node.width = w * dpr res[0].node.height = h * dpr setInterval(() => { ctx1.drawImage(video, 0, 0, w * dpr, h * dpr); }, 1000 / 24) } }).exec() }).exec() },
2022-08-09 - 小程序如何设置手机相册横屏模式 预览
https://developers.weixin.qq.com/miniprogram/dev/api/media/video/wx.chooseMedia.html
2022-07-11