小编And*_*gra的帖子

来自视频的HTML5 Canvas drawImage在第一次绘制时不显示

我有一个带有画布覆盖的视频元素.然后我有一个绘图工具设置来绘制视频和一个保存按钮,从视频和画布执行drawImage以保存一个压缩帧.但是,我第一次按Save我只从画布drawImage获得结果,视频没有显示.在随后的保存中,我收到两个图像正确分层.我认为这可能是加载视频图像的问题,但是在我点击保存之前视频已经完全加载,甚至可以推进帧并使其在第二次保存时正常工作.

这是代码......

<div style="width:960px; height:540px; display:inline-block;">
    <video id="video" src="media/_tmp/AA_017_COMP_v37.mov" width="960" height="540" ></video>
</div>
<canvas id="canvas" width="960" height="540" style="position:absolute; top:40px; left:9px; z-index:100;"></canvas>
<input type="button" value="save" id="btn" size="30" onclick="save()" style="float:left; padding:4px; margin-right:4px;" >
<div id="saved" style="border:1px solid #000; position:absolute; top:626px; left:10px; bottom:40px; width:958px; overflow:auto;">SAVED:</div>


function save() {

    //COMP CANVAS OVER VIDEOFRAME
    var video = document.getElementById("video");
    var currentFrame = Math.floor((<?php echo $mov_frames ?> / video.duration) * video.currentTime);

    var compCanvas = document.createElement('canvas');
    compCanvas.width = video.width;
    compCanvas.height = video.height;
    compContext = compCanvas.getContext('2d');
    compContext.drawImage(video, 0, 0); …
Run Code Online (Sandbox Code Playgroud)

javascript video html5 canvas drawimage

5
推荐指数
1
解决办法
5277
查看次数

如何在多列上左联接3个表

我在这上面停留了一段时间。我有3个表,并且想将表2和3与表1的不同列匹配。

tasks:
id      | item1_id       | item2_id   
--------------------------------------------
1       | 4              | 5   
2       | 5              | 6   
3       | 6              | 7  
--------------------------------------------

item1:
id      | item1_name     
--------------------------------------------
4       | item1_a              
5       | item1_b              
6       | item1_c              
--------------------------------------------

item2:
id      | item2_name     
--------------------------------------------
5       | item2_a              
6       | item2_b              
7       | item2_c              
--------------------------------------------
Run Code Online (Sandbox Code Playgroud)

我一直在尝试的是:

SELECT tasks.id AS taskID, item1.name AS item1Name, item2.name AS item2Name
FROM tasks LEFT JOIN (item1 CROSS JOIN item2) 
ON (tasks.item1_id = item1.id AND tasks.item2_id = …
Run Code Online (Sandbox Code Playgroud)

mysql sql mysqli left-join

2
推荐指数
1
解决办法
6737
查看次数

标签 统计

canvas ×1

drawimage ×1

html5 ×1

javascript ×1

left-join ×1

mysql ×1

mysqli ×1

sql ×1

video ×1