Best way to have a zoom and pan image overlay on Android?
Asked Answered
P

1

6

I'm relatively new to Android development, and I'm currently developing an app that requires a pinch-zoomable and pannable image that will have other images overlaid on top of it, similar to a MapView but without using the Google Maps API.

I've done a bit of looking and found that I may be able to accomplish the overlay portion by doing the method in this question: Draw images on top of each other in android

However, I don't know if that would make the ability of doing a pinch-zoom and/or panning a large image feasible. Would it be worth it to create a GLSurfaceView and just implementing the needed functionality, or is that overkill because I'd be reinventing the wheel?

For what it's worth, the large map image itself will be fetched from a server (but if needed it can be split into smaller square regions), and the icon that will be overlaid at various positions on the map will be embedded in the app itself.

Plainclothesman answered 4/2, 2012 at 21:55 Comment(1)
Did you figure out the best way to do this? :)Michaelmichaela
W
-1

Sony Ericsson made an excellent PinchZoomable ImageView class. I modified it for my needs. I merged their pinch zoom and single-point touch zoom (for phones that didn't have multitouch) http://code.google.com/p/motivatormaker-android/source/browse/MakeMotivator/src/com/sonyericsson/zoom/ImageZoomView.java

Their tutorial is here: http://developer.sonymobile.com/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia-10-apps-part-2/

I got pretty good performance out of using these classes without needing to use OpenGL.

Waylay answered 24/11, 2012 at 7:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.