简体   繁体   中英

Android : Downloading and Displaying images simultaneously?

I'm having a situation in my current project where I want to Download a wallpaper image from network. I want to download the image in chunks and at the same time display whatever image that has been downloaded in a ImageView. How to implement this? The type of Image that I would be downloading would be "PNG".

我认为一种解决方案是每次您要显示图像的新部分时,使用例如以下代码从字节数组创建图像:

BufferedImage image = ImageIO.read(in);

使用ImageView与imageView.setImageBitmap一起使用urlConnection下载文件,并将其inputStream插入BitmapFactory.decodeStram

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM