[英]Convert Bitmap to Bitmap[] array
List<String> url = new ArrayList<String>();
public Bitmap[] thumbs = { };
我從我的方法fetchImage(String url)
獲取圖像
for (int i = 0; i < (url.size()); i++) {
/* I fetch image with param String URL and return as Bitmap */
Bitmap photo = fetchImage(url.get(i));
}
如何將Bitmap photo
推入Bitmap[] thumbs
作為數組?
請執行以下操作:
List<String> url = new ArrayList<String>();
public Bitmap[] thumbs = new Bitmap[url.size()];
for (int i = 0; i < (url.size()); i++) {
/* I fetch image with param String URL and return as Bitmap */
thumbs[i] = fetchImage(url.get(i));
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.