1

I have a image (resolution 8328x3987). And I want to load that image in my app with zoom controls for better viewing.

As we all know that Android will not load large images directly on device (like in my example). So Android system suggested us to scale down the image to load large images. I have tried this and scale my image upto four times as:

options.inSampleSize = 4;

Using this way my image will displayed on screen, but when I zoom-in the image then this image becomes unreadable (text becomes very blurry), this is because, maybe I scale down the image before showing?

But when I see that image in to device's default gallery app (Android Lollipop, Photos app), then this image looks like a mapview (only visible portion is readable and outside is blurry, and when I move the image then visible area becomes readable) when I zoomed in at max level. So my questions is:

Is Android lollipop added any new way to load large files that looks like mapview?

If not, then do you have an idea how that apps do this or any example?

Pankaj
  • 7,908
  • 6
  • 42
  • 65
Mca Dc
  • 11
  • 6

1 Answers1

0

Reducing the sample size of an image that big will not work at all.(very very bad resolution and memory consumption)

I suggest you to divide image to tiles and recycle the views just like map views do.

This library may help you. Or you can do it your way too.

Ercan
  • 3,705
  • 1
  • 22
  • 37