How to get photo from web cam and store it into a varbinary column with ASP.NET 4.0

你。 提交于 2020-01-16 15:54:17

问题


I just want take online photo for student entry (school management). I can't take photo from the web cam. No effects occurs on page.

<script src="Webcam_Plugin/jquery.webcam.js" type="text/javascript"></script>
    <script type="text/javascript">
        var pageUrl = "student_admision.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);
                            var img = new Image();
                            img.src = r.d;
                            img.onload = function () {
                                $("[id*=imgCapture]")[0].src = img.src;
                                $("[id*=imgCapture]").show();
                                $("#imgLoader").hide();
                            };

                        },
                        failure: function (response) {
                            alert(response.d);
                        }
                    });
                },
                onCapture: function () {
                    webcam.save(pageUrl);
                }
            });
        });
        function Capture() {
            $("#imgLoader").show();
            $("[id*=imgCapture]").hide();
            webcam.capture();
            return false;
        }
    </script>

But no flash object appears on my page. Can anyone refer me to the best article?

来源:https://stackoverflow.com/questions/58772280/how-to-get-photo-from-web-cam-and-store-it-into-a-varbinary-column-with-asp-net

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!