android多点触控图像缩放?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3055133/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 08:29:59  来源:igfitidea点击:

android multitouch image zooming?

androidimageviewmulti-touch

提问by UMAR

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 版本。

回答by Janusz

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

可以使用webview来显示本地文件。Webview 集成了多点触控缩放。看看我的问题,关于这个话题。

回答by Jason Polites

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...

可能对某人有用...

回答by James

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.

您是否尝试过使用意图“android.intent.action.VIEW”并让手机的内置图像查看器显示您的图像?如果手机支持,它可能会使用多点触控控制。

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

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

回答by Tim Kryger

A recent post on the Android Developers Blogincludes an examplethat does exactly what you ask. Unfortunately, it relies upon ScaleGestureDetecterwhich makes its first appearance in Froyo.

Android 开发者博客上最近的一篇文章包含一个完全符合您要求的示例。不幸的是,它依赖于首次出现在 Froyo 中的ScaleGestureDetecter

回答by Micha? Majcherski

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

关于手势图像视图库: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. It solved my usecase.

无论如何,尝试的好lib。它解决了我的用例。