简体   繁体   中英

Load a very large Image in android

Assumes I have a picture, it very large images or other sets of content where you are only looking at small bits at a time, because you can start seeing your content without having to load it all into memory at once.

In iOs we can use CATiledLayer to repeatedly draw tiles to fill up view's background

In Android I can see Google Map, It also load each part of map when you scroll but I don't understand what is solution of them.

I want know what is the solution same CATiledLayer in Android or other to load very large Image

you can actually scale down the bitmap according to the size of the image view.

Don't give wrap_content in width and height try to give a relative width and height. use

ImageView.getheight()
ImageView.getWidth()

get the size and load according to it see this link http://developer.android.com/training/displaying-bitmaps/load-bitmap.html#read-bitmap

You can use a library load images efficiently and manage caching them instead of downloading them again. I suggest Picasso or Glide . This tutorial compares between them and explains few features.
I hope it's useful.

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