开发者

Android - How to specify photo file name/directory using Phonegap

开发者 https://www.devze.com 2023-04-02 02:07 出处:网络
How can I specify the name an开发者_开发问答d destination of captured photo using Phonegap? Couldn\'t find this info anywhere. Right now it just goes to /sdcard/pic.jpg.

How can I specify the name an开发者_开发问答d destination of captured photo using Phonegap? Couldn't find this info anywhere. Right now it just goes to /sdcard/pic.jpg.

Here's what I have so far:

function capturePhoto() {
navigator.camera.getPicture(onSuccess, onFail, { quality: 50,  
destinationType: Camera.DestinationType.FILE_URI });  

function onSuccess(imageURI) { 
var image = document.getElementById('myImage'); 
image.style.display = 'block';
image.src = imageURI; 
} 

function onFail(message) { 
alert('Failed because: ' + message); 
} 
}


try content://media/external/images/media/n

where n is the image number you are trying to call (1,2,3, etc)

0

精彩评论

暂无评论...
验证码 换一张
取 消