文件名称:ASP.NET MVC Flash 在线拍照
文件大小:56KB
文件格式:RAR
更新时间:2017-07-07 10:37:25
ASP.NET MVC Flash 在线拍照
//拍照
$("#btn_shoot").click(function () {
webcam.freeze();
$("#shoot").hide();
$("#upload").show();
return false;
});
//重拍
$('#btn_cancel').click(function () {
webcam.reset();
$("#shoot").show();
$("#upload").hide();
return false;
});
//上传
$('#btn_upload').click(function () {
webcam.upload();
webcam.reset();
$("#shoot").show();
$("#upload").hide();
return false;
});
//回调
webcam.set_hook('onComplete', function (data) {
var msg = $.parseJSON(data);
if (msg.error) {
alert(msg.message);
}
else {
// Adding it to the page;
var pic = '/Content/' + msg.filename;
//$("#photos").attr("src", pic);
$("#photos").append('');
}
});
//错误
webcam.set_hook('onError', function (e) {
alert(e);
});
【文件预览】:
ASP.NET MVC 在线拍照
----Controllers()
--------PhotoController.cs(992B)
----Scripts()
--------jquery-1.8.2.min.js(92KB)
--------JPEGCam()
----Views()
--------Photo()
----Content()
--------Images()