當前位置:首頁 » 安卓系統 » android選擇圖片多張

android選擇圖片多張

發布時間: 2024-01-17 10:52:46

❶ android如何從伺服器取多張圖片,在本地保存並顯示

//獲取connection conn = getURLConnection(url); is = conn.getInputStream(); //獲取Bitmap的引用 Bitmap bitmap = BitmapFactory.decodeStream(is) //獲取長度 int length = (int) conn.getContentLength(); if (length != -1) { byte[] imgData = new byte[length]; byte[] temp=new byte[512]; int readLen=0; int destPos=0; while((readLen=is.read(temp))>0){ System.array(temp, 0, imgData, destPos, readLen); destPos+=readLen; } bitmap=BitmapFactory.decodeByteArray(imgData, 0, imgData.length); }可能想得不是很完善,你可以參考參考。

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:708
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:971
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:680
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:832
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:739
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1079
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:310
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:190
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:877
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:834