我正在使用 ionic 和 cordova 构建应用程序。我设法访问了相机胶卷并让用户可以手动选择一张照片。 但是,我不确定如何在没有人工交互的情况下自动访问所有照片。我想将它们附加到我的代码中的数组以进行进一步处理。 我找到了这个插件,但它对我不起作用:
https://github.com/driftyco/cordova-camera-roll
谢谢。
最佳答案
一次最多可选择 10 张图像。
使用多图像选择器插件最多选择 10 张图像。
Github 链接- https://github.com/wymsee/cordova-imagePicker
安装-
phonegap plugin add https://github.com/wymsee/cordova-imagePicker.git
cordova plugin add https://github.com/wymsee/cordova-imagePicker.git
示例 -
window.imagePicker.getPictures(
function(results) {
for (var i = 0; i < results.length; i++) {
console.log('Image URI: ' + results[i]);
}
}, function (error) {
console.log('Error: ' + error);
}, {
maximumImagesCount: 10,
width: 800
}
);
关于javascript - Cordova,从相机胶卷中获取所有图片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32795381/