iOS Question Best solution for zoomable images?

nwhitfield

Active Member
Licensed User
Longtime User
I have an app that displays photos uploaded to a member. At the moment, I'm just displaying the "standard def" images that we have on the site, which are sized to a maximum of 600 pixels.

However, some users would like zoomable images, and to have the high-res images we can display on the desktop. I'm trying to find the best way to handle this.

With the standard images, I pre-load some of them into an array of bitmaps, and display them in an imageview. A gesture recogniser allows swiping left and right through them, and an underlying list keeps track of which ones have been loaded into the array, and which ones have to be fetched. On the whole, it works well. But it doesn't zoom.

I've tried using https://www.b4x.com/android/forum/threads/cvizoomableimageview.74527/ but I can't get that to behave well when I change one image to another; I've tried resetting the interior scrollview and its X and Y offsets, but to no avail. Typically the first image, will appear in the right place, but once you've zoomed around a bit, subsequent ones might be partially off screen, or way to small and so on.

The alternative is to use a webview, and I could do that relatively easily. But the problem with that is that I can't pre-load (and also, without a lot of fiddling, the images won't centre vertically, unlike an imageview in 'fit' mode). I could cache some of the images on the phone, I suppose, but then I also have to worry about managing saved images.

Does anyone have an alternative solution for making images zoom? Or a way to make cviZoomableImageview reset completely when I swap from one bitmap to another?
 
Top