Skip to content

Commit

Permalink
made changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sidntrivedi012 committed Aug 21, 2019
1 parent 0f95bb5 commit 43b216a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion examples/capture/capture.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,10 @@ $W = {
$W.preview_ctx.translate($("#preview").width(), 0);
$W.preview_ctx.scale(-1, 1);
}
if ($W.loadingfromPi) var videoSrc = $W.piImage;
else var videoSrc = $("video")[0];
$W.preview_ctx.drawImage(
$("video")[0],
videoSrc,
0,
0,
$("#preview").width(),
Expand Down
4 changes: 2 additions & 2 deletions examples/capture/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
<p style="padding-top:5px;">
Help <a href="http://publiclab.org/wiki/spectral-workbench-usage#Webcam+selection">selecting a camera</a>
<!--the connect to raspberry-pi button-->
<a class="btn btn-large btn-primary" id="pi-button" href="">Connect to Raspberry-Pi</a>
<a class="btn btn-large btn-primary" id="pi-button" href="#">Connect to Raspberry-Pi</a>
</p>

<a class="btn btn-large btn-primary" href="#capture" onClick="$('#capture-btn').addClass('active');$('#settings-btn').removeClass('active');" data-toggle="tab">Begin capturing &raquo;</a>
Expand Down Expand Up @@ -361,7 +361,7 @@ <h3 style="text-align:left;margin-left:15px;">Macros</h3>
//if pi_div button does not return null
document.getElementById("pi-button").addEventListener("click", function connect_to_pi() {
$W.loadingfromPi=true;
var piImage = new Image();
$W.piImage = new Image();
piImage.onload = function () {
var sourceX = 0, sourceY = 0, sourceHeight = 300, sourceWidth = 800;
$W.ctx.drawImage(piImage, sourceX, sourceY, sourceHeight, sourceWidth, 0, 0, $W.width, 1);
Expand Down

0 comments on commit 43b216a

Please sign in to comment.