简体   繁体   English

android多点触控图像缩放?

[英]android multitouch image zooming?

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. 我使用的是2.1 sdk版本。

There is the possibility to use a webview to display a local file. 可以使用webview显示本地文件。 The Webview has integrated multitouch zooming. Webview集成了多点触控缩放功能。 Have a look at my question regarding this topic. 看看我的问题,关于这个话题。

I have a working implementation for 2.1+ 我有2.1+的工作实现

WebView solution caused problems for me on 4.0.x (lot's of weird white spaces appearing) WebView解决方案在4.0.x上给我带来了问题(出现了很多奇怪的白色空间)

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

Might be useful for someone... 可能对某人有用......

A recent post on the Android Developers Blog includes an example that does exactly what you ask. Android开发者博客上的最新帖子包含了一个完全符合您要求的示例 Unfortunately, it relies upon ScaleGestureDetecter which makes its first appearance in Froyo. 不幸的是,它依赖于ScaleGestureDetecter ,它首次出现在Froyo。

Have you tried using the intent "android.intent.action.VIEW" and letting the phone's built in image viewer display your image? 您是否尝试过使用意图“android.intent.action.VIEW”并让手机的内置图像查看器显示您的图像? It will probably use multi-touch controls if the phone supports it. 如果手机支持,它可能会使用多点触控。

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

Regarding gesture-imageview lib: https://github.com/jasonpolites/gesture-imageview 关于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 它实际上很有用,但不幸的是它有一些错误,例如: https//github.com/jasonpolites/gesture-imageview/issues/37

Anyway, good lib to try. 无论如何,好的lib尝试。 It solved my usecase. 它解决了我的用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM