0
我一直在使用以下代码来抓取图片并在html中显示效果很好。Phonegap - 将图像捕获到图片库并显示在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
谢谢,我看着MediaFile对象的事情,并有点困惑。我看起来更难。 – adamprocter
至于编辑我的意思是当我使用camera.getPicture并设置allowedit:true我可以调整照片,然后再“保存”它。基本的剪裁真的,我想保持这个功能。再次感谢 – adamprocter
Camera API提供了比Capture API更多的功能,这就是为什么在使用Capture进行保存之前无法进行编辑的原因。 –