Click here to Skip to main content
15,911,132 members

Comments by Muied Ahmad (Top 1 by date)

Muied Ahmad 9-Nov-17 23:55pm View    
var pageUrl = "WebCamImageCapture.aspx";

$(function () {
jQuery("#webcam").webcam({
width: 320,
height: 240,
mode: "save",
swffile: "Webcam_Plugin/jscam.swf",
debug: function (type, status) {

$('#camStatus').append(type + ": " + status + '<br /><br />');
},
onSave: function (data) {
$.ajax({
type: "POST",
url: pageUrl + "/GetCapturedImage",
data: '',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (r) {
$("[id*=imgCapture]").css("visibility", "visible");
$("[id*=imgCapture]").attr("src", r.d);
},
failure: function (response) {

}
});
},
onCapture: function () {
webcam.save(pageUrl);
}
});

});
function Capture() {

webcam.capture();

return false;
}



Live Camera
Captured Picture

<object id="webcam">



<asp:Image ID="imgCapture" runat="server" Style="width: 320px;
height: 240px;" />



<asp:Button ID="btnCapture" Text="Capture" runat="server" OnClientClick="return Capture();" />