當前位置:首頁 » 安卓系統 » 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); }可能想得不是很完善,你可以參考參考。

熱點內容
sql2008隨機數 發布:2025-08-26 02:37:48 瀏覽:343
做個電商網站需要什麼伺服器 發布:2025-08-26 02:37:42 瀏覽:267
php獲取當前目錄 發布:2025-08-26 02:30:29 瀏覽:467
伺服器終端不需要電腦 發布:2025-08-26 02:20:50 瀏覽:5
最小二乘濾波演算法 發布:2025-08-26 02:09:24 瀏覽:495
安卓系統怎麼加內存卡 發布:2025-08-26 02:08:38 瀏覽:245
16款凱美瑞推薦哪個配置 發布:2025-08-26 02:08:38 瀏覽:995
湖北高考生拍題上傳 發布:2025-08-26 01:58:54 瀏覽:120
美國伺服器租什麼好 發布:2025-08-26 01:54:02 瀏覽:834
還原錯誤的密碼是多少 發布:2025-08-26 01:34:12 瀏覽:168