直接書き込めばちゃんとそれ通りのwidthとheightになるんですが、riotの下記の書き方だとデフォルトのwidth300pxとheight150pxが反映されてしまいます。
HTML
1<canvas width="{ canvasWidth }" height="{ canvasHeight }" ref="canvas"></canvas>
javascript
1var style = tag.refs.uploadWrapper.currentStyle || document.defaultView.getComputedStyle(tag.refs.uploadWrapper, '') 2tag.canvasWidth = style.width 3tag.canvasHeight = parseFloat(tag.canvasWidth) / 16 * 9 + 'px'
javascript
1grandParentTag.refs.canvas.getContext('2d').drawImage(this.refs.video, 0, 0, parseFloat(grandParentTag.canvasWidth), grandParentTag.canvasHeight)
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。