Capture from webcam and save using JQuery

cRoNiC

New Member
JS_TEST.aspx\[code\]<head runat="server"> <title></title> <script src="http://stackoverflow.com/questions/15733536/Scripts/JS_TEST/mshsayem.js" type="text/javascript"></script></head><body> <form id="form1" runat="server"> <div id="sc" style="width: 218px"> <div id="imgWrapper"> <img src="http://stackoverflow.com/questions/15733536/~/JS_TEST_IMG.aspx" alt="no photo" id="imgPhoto" runat="server" height="262" width="215" /> </div> <br /> <div style="text-align: center"> <span id="tp">Open Webcam</span> </div> <br /></div><div id="iUploadFrame" style="display: none;"> <div id="fc"> -- Cam Content -- </div> <div id="upStatus" style="padding: 5px 0; color: #666;"> Adjust, snap, then upload</div> <input type="button" value="http://stackoverflow.com/questions/15733536/Snap" onclick="webcam.freeze()" /> <input type="button" value="http://stackoverflow.com/questions/15733536/Reset" onclick="camReset();" /> <input type="button" value="http://stackoverflow.com/questions/15733536/Upload" onclick="handleUpload()" /> <div class="progress_beside_inline" id="ghimg"> <asp:Image ID="Image1" runat="server" /> </div></div> </form></body></html>\[/code\]JS_TEST_IMG.aspx\[code\]<head runat="server"> <title></title> <script src="http://stackoverflow.com/questions/15733536/Scripts/JS_TEST/mshsayem.js" type="text/javascript"></script></head><body> <form id="form1" runat="server"> <div> <asp:Image ID="Image1" runat="server" /> </div> </form></body></html>\[/code\]JQuery file:\[code\]<script type="text/javascript" src="http://stackoverflow.com/questions/15733536/<path to webcam.js (inside jpegcam)>"></script><script type="text/javascript"> $(function () { webcam.set_swf_url('path to webcam.swf(inside jpegcam)'); webcam.set_api_url(document.URL); webcam.set_quality(90); // JPEG quality (1 - 100) webcam.set_shutter_sound(false); $("#imgWrapper").css({ height: "262px", width: "215px", border: "solid 1px #aaa" }); var pb = $("#tp"); pb.addClass("spbtn"); pb.click(function () { $("#fc").html(webcam.get_html(215, 262)); viewCam(true); });});function viewCam(show) { if (show) { $("#sc").hide(); $("#iUploadFrame").fadeIn(); } else { $("#iUploadFrame").hide(); $("#sc").fadeIn(); }}function camReset() { webcam.reset(); setCamInstruction("Adjust, snap, then upload", "#666");}function setCamInstruction(msg, c) { $("#upStatus").html(msg).css("color", c);}function handleUpload() { var gi = $("#ghimg"); gi.css("visibility", "visible") webcam.upload(document.URL, function () { gi.css("visibility", "hidden") setCamInstruction("Upload complete!", "green"); });}</script>\[/code\]IT IS NOT WORKING, why ?Does someone has a better way to capture a picture from webcam and save to a folder in png,jpg,bmp format ?using VS2010 Express edition (VB)
 
Back
Top