簡體   English   中英

將Bitmap轉換為Bitmap []數組

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM