【发布时间】:2012-01-23 22:46:40
【问题描述】:
我一直在使用下面的代码来抓取一张照片并在 html 中显示效果很好。
function takePicture() {
navigator.camera.getPicture(
function(uri) {
var img = document.getElementById('camera_image1');
img.style.visibility = "visible";
img.style.display = "block";
img.src = uri;
document.getElementById('camera_status').innerHTML = "Success";
},
{ quality: 50, allowEdit: true, destinationType: navigator.camera.DestinationType.FILE_URI});
};
html 稍后
<img style="width:144px;height:144px;" id="camera_image1" src="nophoto.jpg"/>
但是...这不会将图像保存到相机照片库中,所以我将线条调整为
navigator.device.capture.captureImage
现在这会将图像捕获到库中,但是
- 不再显示在 html 中
- 不再允许我在相机“应用”中拍照后编辑照片
非常感谢任何指针。
PhoneGap 1.3
【问题讨论】:
标签: cordova camera capture image-capture photolibrary