当前位置:首页 » 安卓系统 » 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