2013-09-25 33 views

回答

1

確保遵循Phonegap Documentation

給出隨着capureImage功能的說明,您正在訪問的攝像頭應用程序用於拍攝的圖像,而不是這個,你應該使用Getpicture中功能與正確sourceType從您的畫廊獲取圖片。

具體而言,該功能將打開你的畫廊和處理過程

function getPhoto() { 
    // Retrieve image file location from specified source 
    navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50, 
    destinationType: navigator.camera.DestinationType.FILE_URI, 
    sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY }); 
} 

注: 在的Android,SAVEDPHOTOALBUM和PHOTOLIBRARY是圖片sourceType的一樣,如果沒有提供,sourceType的是Camera.PictureSourceType .CAMERA默認情況下會導致您的應用從相機中檢索圖片。