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

热点内容
php一键环境 发布:2025-08-25 20:20:34 浏览:161
无油螺杆式空气压缩机 发布:2025-08-25 20:16:06 浏览:815
python文件到输出到文件 发布:2025-08-25 20:15:58 浏览:133
python打印日志 发布:2025-08-25 19:37:00 浏览:413
vr哪个配置最好 发布:2025-08-25 19:36:51 浏览:836
解压挤痘视频 发布:2025-08-25 19:34:31 浏览:310
老鼠脚本是什么意思 发布:2025-08-25 19:27:59 浏览:476
androidlongstring 发布:2025-08-25 19:25:00 浏览:495
app制作androidstudio 发布:2025-08-25 19:14:12 浏览:242
hibernate连接数据库 发布:2025-08-25 18:55:37 浏览:720