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

熱點內容
腳本創造 發布:2025-10-19 20:31:29 瀏覽:224
登記微信初始密碼是多少 發布:2025-10-19 20:07:34 瀏覽:181
A演算法典題 發布:2025-10-19 20:02:24 瀏覽:152
sqlintstring 發布:2025-10-19 19:54:02 瀏覽:415
sql2008企業管理器 發布:2025-10-19 19:43:51 瀏覽:435
centos8如何配置nfs 發布:2025-10-19 19:29:51 瀏覽:535
腳本預約 發布:2025-10-19 19:03:59 瀏覽:122
android多圖上傳 發布:2025-10-19 19:03:59 瀏覽:635
linux開通ftp 發布:2025-10-19 18:55:13 瀏覽:325
軟體編程技術培訓機構 發布:2025-10-19 18:13:32 瀏覽:865