从URL加载图像 [英] Load image from url

查看:166
本文介绍了从URL加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个IMAGEURL为<一个href="http://image10.bizrate-images.com/resize?sq=60&uid=2216744464">http://image10.bizrate-images.com/resize?sq=60&uid=2216744464 我想显示从这个网址上的ImageView的图像,但我无法做到这一点。

将如何实现?

解决方案

 网​​址URL =新的URL(http://image10.bizrate-images.com/resize?sq=60& ; UID = 2216744464);
BMP位= BitmapFactory.de codeStream(url.openConnection()的getInputStream());
imageView.setImageBitmap(BMP);
 

Guys, I have a imageurl as http://image10.bizrate-images.com/resize?sq=60&uid=2216744464 I want to display an image from this url on ImageView but I unable to do that.

How it will be achieved?

解决方案

URL url = new URL("http://image10.bizrate-images.com/resize?sq=60&uid=2216744464");
Bitmap bmp = BitmapFactory.decodeStream(url.openConnection().getInputStream());
imageView.setImageBitmap(bmp);

这篇关于从URL加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆