2012-12-26 65 views
0

我正在尝试创建照片的缩略图,但我失败了,有人可以给我一个想法吗?显示我拍摄的照片的缩略图 - Phonegap

我与PhoneGap的,JavaScript的,HTML和CSS

+1

你做了什么失败了吗? – m90

+1

[你有什么想法](http://mattgemmell.com/2008/12/08/what-have-you-tried/) – Champ

回答

2

工作试试这个:

$('#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 } 
     ); 
}); 
+2

但是如果你有一个大的图像列表会很慢,因为它调整大小图像,不是缩略图... – Caipivara