问题
I'm trying to create a thumbnail of the photo that I take with the camera but I've failed, someone can give me an idea?
I'm working with PhoneGap, javascript, html and css
回答1:
Try this:
$('#button').click(function(){
navigator.camera.getPicture(
function(imageURI){
$('img').attr('src',imageURI).css({'background-size': '100%', 'background-repeat': 'no-repeat', 'width': '100px'});
},
function(message) { alert('Get picture failed'); },
{ quality: 60,
destinationType: navigator.camera.DestinationType.FILE_URI,
sourceType: navigator.camera.PictureSourceType.CAMERA,
mediaType: Camera.MediaType.PICTURE,
correctOrientation: true }
);
});
来源:https://stackoverflow.com/questions/14043174/to-show-a-thumbnail-of-photo-that-i-took-phonegap