2012-12-26 71 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