I have been using the following code to grab a photo and display it in html works great.
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 later
<img style="width:144px;height:144px;" id="camera_image1" src="nophoto.jpg"/>
but... this does not save the image to the cameras photo library so I tweaked line to
navigator.device.capture.captureImage
This now captures image to library but
- no longer displays in html
- No longer allows me to edit the photo after I have taken photo in the camera 'app'
Any pointer much appreciated.
PhoneGap 1.3