14

I'm displaying an image on full screen now i want to zoom it in or out. Any one guide on how I can implement multi touch image zooming?

I am using the 2.1 sdk version.

Janusz
  • 187,060
  • 113
  • 301
  • 369
UMAR-MOBITSOLUTIONS
  • 77,236
  • 95
  • 209
  • 278

5 Answers5

9

There is the possibility to use a webview to display a local file. The Webview has integrated multitouch zooming. Have a look at my question regarding this topic.

Community
  • 1
  • 1
Janusz
  • 187,060
  • 113
  • 301
  • 369
  • means zoomcontrols not the webview. – UMAR-MOBITSOLUTIONS Jun 17 '10 at 09:45
  • sorry I can't understand your comments. If you want multitouch zooming and zoom controls for an Image you can show the image in an webview this will add multitouch zooming for the image and also show the zoom controls after the first touch event on the view – Janusz Jun 17 '10 at 10:13
  • A web view is the best way to do it. – gregm Oct 26 '10 at 21:19
6

I have a working implementation for 2.1+

WebView solution caused problems for me on 4.0.x (lot's of weird white spaces appearing)

https://github.com/jasonpolites/gesture-imageview

Might be useful for someone...

Jason Polites
  • 5,571
  • 3
  • 25
  • 24
5

A recent post on the Android Developers Blog includes an example that does exactly what you ask. Unfortunately, it relies upon ScaleGestureDetecter which makes its first appearance in Froyo.

Tim Kryger
  • 11,166
  • 4
  • 52
  • 41
5

Have you tried using the intent "android.intent.action.VIEW" and letting the phone's built in image viewer display your image? It will probably use multi-touch controls if the phone supports it.

http://developer.android.com/reference/android/content/Intent.html#ACTION_VIEW

James
  • 577
  • 1
  • 3
  • 14
1

Regarding gesture-imageview lib: https://github.com/jasonpolites/gesture-imageview

it's in fact useful, but unfortunatelly it has some bugs, like: https://github.com/jasonpolites/gesture-imageview/issues/37

Anyway, good lib to try. It solved my usecase.