Kristy.tsui
Kristy.tsui

Reputation: 1

how to partial loading a very big picture from the internet?

i hava a problem ,i want to display a very long picture from the internet in the listView with Adapter,but it occured a problem :Bitmap too large to be uploaded into a texture (600x4517, max=4096x4096). if i add a statement like this:android:hardwareAccelerated="false" in the Manifest.xml,it can display,but the experience of the scrolling not well. if i use BitmapFactory to compress image pixels ,it will make the picture fuzzy. if i want to diaplay a picture without Image deformation,what can i do ? I hava an idea,if i can loading parts of the picture which it can be visible? the project use volley and Glide.Thanks for everyone

Upvotes: 0

Views: 53

Answers (1)

Knossos
Knossos

Reputation: 16068

Loading images for Android can be a hazardous process.

You are loading extremely large images. Android is notoriously bad at dealing with those. Commonly resulting in OutOfMemoryErrors.

You would be well advised in reconsidering network loading massive images on your device. Especially in a ListView!

Additionally, it is good to use an established library for this kind of functionality. Such as Picasso.

Example:

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);

Upvotes: 1

Related Questions