1

您好,我正在为我的项目使用jQuery AS3 网络摄像头插件。但可以弄清楚如何获取拍摄的照片并将其添加到上传表单字段(如果可能的话)。当我单击捕获按钮时,它会在捕获窗口中显示图片,但实际上如何保存呢?

           $("#webcam").webcam({
                swffile: "js/sAS3Cam.swf?v=20120613",

                previewWidth: 400,
                previewHeight: 300,

                resolutionWidth: 400,
                resolutionHeight: 300,

                noCameraFound: function () {
                    this.debug('error', 'Kamera negalima');
                },

                swfApiFail: function(e) {
                    this.debug('error', 'Įskiepio klaida');
                },

                cameraDisabled: function () {
                    this.debug('error', 'Prašom suteikti leidimą prisijungti kamrai prie puslapio');
                },

                debug: function(type, string) {
                    if (type == 'error') {
                        alert(string);
                    }
                },

                cameraEnabled:  function () {
                    this.debug('notice', 'Camera enabled');
                    var cameraApi = this;
                    if (cameraApi.isCameraEnabled) {
                        return;
                    } else {
                        cameraApi.isCameraEnabled = true;
                    }

                    setTimeout(function() {
                        $(".capture").slideDown('fast');
                    }, 750);

                    $('.capture_btn').click(function() {
                        $(".capture").slideUp('fast');
                        $(".save_img").slideDown('fast');
                        var result = cameraApi.save();
                        if (result && result.length) {
                            var actualShotResolution = cameraApi.getResolution();
                          $('.reload_camera').click(function() {
                             cameraApi.isCameraEnabled = true;
                          }); 
                } else {
                    cameraApi.debug('error', 'Bloga kamera');
                }
            });
        }
    });
      <form action="processupload.php" style="display: none" method="post" enctype="multipart/form-data" id="UploadForm">
            <table width="500" border="0">
                <tr>
                    <td><input name="ImageFile" id="file" type="file" /></td>
                </tr>
                <tr>
                    <td style="display: none;"><input type="submit"  id="SubmitButton" value="Upload" /></td>
                </tr>
            </table>
        </form>
4

0 回答 0