我一直在使用以下代码来抓取照片并以 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 中
- 在相机“应用程序”中拍照后不再允许我编辑照片
任何指针都非常感谢。
电话间隙 1.3