Cordova iPhone phonegap摄像头插件,可在一次摄像头调用中拍摄多张图像

Cordova iPhone phonegap摄像头插件,可在一次摄像头调用中拍摄多张图像,cordova,camera,Cordova,Camera,Phonegap的摄像头插件允许每次调用仅拍摄一张图像 在iOS中说 不支持limit参数。每张照片一张 调用 如何使以下内容成为可能 调用摄影机 拍摄一张照片,并保存到背景中的相机卷。不要关上相机。重复此步骤 当相机处于活动状态时,需要一个半透明层,底部有一个“显示图像”按钮。单击此按钮,关闭相机并显示相机滚动图像 github中是否有可用的代码示例?如果您使用的是捕获插件而不是相机插件,则可以指定要为一次会话中拍摄的照片设置的限制。参考phonegap 3.0捕获插件文档。我相信在2.2中也

Phonegap的摄像头插件允许每次调用仅拍摄一张图像

在iOS中说 不支持limit参数。每张照片一张 调用

如何使以下内容成为可能

  • 调用摄影机
  • 拍摄一张照片,并保存到背景中的相机卷。不要关上相机。重复此步骤
  • 当相机处于活动状态时,需要一个半透明层,底部有一个“显示图像”按钮。单击此按钮,关闭相机并显示相机滚动图像

  • github中是否有可用的代码示例?

    如果您使用的是捕获插件而不是相机插件,则可以指定要为一次会话中拍摄的照片设置的限制。参考phonegap 3.0捕获插件文档。我相信在2.2中也是如此

    下面是一些关于如何调用捕获会话的代码

    <script type="text/javascript" charset="utf-8">
    
    // Called when capture operation is finished
    //
    function captureSuccess(mediaFiles) {
        var i, len;
        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
            uploadFile(mediaFiles[i]);
        }
    }
    
    // Called if something bad happens.
    //
    function captureError(error) {
        var msg = 'An error occurred during capture: ' + error.code;
        navigator.notification.alert(msg, null, 'Uh oh!');
    }
    
    // A button will call this function
    //
    function captureImage() {
        // Launch device camera application,
        // allowing user to capture up to 2 images
        navigator.device.capture.captureImage(captureSuccess, captureError, {limit: 2});
    }
    
    // Upload files to server
    function uploadFile(mediaFile) {
        var ft = new FileTransfer(),
            path = mediaFile.fullPath,
            name = mediaFile.name;
    
        ft.upload(path,
            "http://my.domain.com/upload.php",
            function(result) {
                console.log('Upload success: ' + result.responseCode);
                console.log(result.bytesSent + ' bytes sent');
            },
            function(error) {
                console.log('Error uploading file ' + path + ': ' + error.code);
            },
            { fileName: name });
    }
    
    </script>
    
    
    //捕获操作完成时调用
    //
    函数CaptureSucture(媒体文件){
    变量i,len;
    对于(i=0,len=mediaFiles.length;i

    这将使您了解捕获图像的图像文件名和位置。我会试着编辑我的答案,如果我弄明白了,那么稍后如何将这些保存到相机卷中。注意。。。。如果使用captureVideo功能,这也适用于视频。还包括uploadFile功能,您可以将这些图像发布到服务器。在该函数中,它显示了如何引用图像文件的完整路径以及图像文件名。这将有助于你努力将这些照片放到相机上。注意fileTransfer对象可能需要文件插件,但也肯定需要fileTransfer插件。

    如果使用捕获插件而不是相机插件,则可以指定要为一次会话中拍摄的照片设置的限制。参考phonegap 3.0捕获插件文档。我相信在2.2中也是如此

    下面是一些关于如何调用捕获会话的代码

    <script type="text/javascript" charset="utf-8">
    
    // Called when capture operation is finished
    //
    function captureSuccess(mediaFiles) {
        var i, len;
        for (i = 0, len = mediaFiles.length; i < len; i += 1) {
            uploadFile(mediaFiles[i]);
        }
    }
    
    // Called if something bad happens.
    //
    function captureError(error) {
        var msg = 'An error occurred during capture: ' + error.code;
        navigator.notification.alert(msg, null, 'Uh oh!');
    }
    
    // A button will call this function
    //
    function captureImage() {
        // Launch device camera application,
        // allowing user to capture up to 2 images
        navigator.device.capture.captureImage(captureSuccess, captureError, {limit: 2});
    }
    
    // Upload files to server
    function uploadFile(mediaFile) {
        var ft = new FileTransfer(),
            path = mediaFile.fullPath,
            name = mediaFile.name;
    
        ft.upload(path,
            "http://my.domain.com/upload.php",
            function(result) {
                console.log('Upload success: ' + result.responseCode);
                console.log(result.bytesSent + ' bytes sent');
            },
            function(error) {
                console.log('Error uploading file ' + path + ': ' + error.code);
            },
            { fileName: name });
    }
    
    </script>
    
    
    //捕获操作完成时调用
    //
    函数CaptureSucture(媒体文件){
    变量i,len;
    对于(i=0,len=mediaFiles.length;i

    这将使您了解捕获图像的图像文件名和位置。我会试着编辑我的答案,如果我弄明白了,那么稍后如何将这些保存到相机卷中。注意。。。。如果使用captureVideo功能,这也适用于视频。还包括uploadFile功能,您可以将这些图像发布到服务器。在该函数中,它显示了如何引用图像文件的完整路径以及图像文件名。这将有助于你努力将这些照片放到相机上。注意fileTransfer对象可能需要文件插件,但也肯定需要文件传输插件。

    在某些网站上,这意味着此限制功能无法与ios配合使用,因此任何其他实现摄像头的替代方案都不会被取消,直到我们按下“后退”按钮,以便我们可以在某些网站上继续单击照片。

    在某些网站上,这意味着此限制功能无法与ios配合使用,因此任何其他实现摄像头的替代方案都不会被取消,直到我们按下后退按钮,以便我们可以继续单击照片

    在中找到目标代码在中找到目标代码