0
我正在與nativescript的Android應用程序,我使用couchbase數據庫和我需要存儲與相機模塊用於拍攝的照片參考項目的縮略圖,並在列表視圖內顯示這些照片。
我已經搜查多個教程如何將攝像頭模塊,並使用ImageSource的類顯示圖像,而當我使用fromAsset路過cameraModule.takePicture返回的對象,他們的工作,而不是當我使用fromFile傳遞路徑在同一個對象中(picture.android屬性),因爲它似乎只適用於應用程序文件夾。顯示照片在設備上的nativescript Android應用
cameraModule.takePicture().then((picture) => {
let myImage = page.getViewById("image-test");
let source = new imageSource.ImageSource();
// This works
source.fromAsset(picture).then(source => {
myImage.imageSource = source;
});
// This doesn't
source.fromFile(picture.android).then(source => {
myImage.imageSource = source;
});
});
什麼是最好的方式來存儲引用和重新創建imageSource?我可以存儲整個imageAsset對象在couchbase中嗎?或者什麼是正確的方式來創建一個imageSource惠普路徑?