【问题标题】:How pinch zoom image in image zoom android? [closed]如何在图像缩放android中捏缩放图像? [关闭]
【发布时间】:2013-05-29 10:55:04
【问题描述】:

我必须在图像视图中显示图像。 而我想要做的只是简单地在 imageview 上进行捏合和缩放功能。

【问题讨论】:

标签: android image zooming pinch


【解决方案1】:

您可以使用 Chrisbanes photoview 库:

https://github.com/chrisbanes/PhotoView

【讨论】:

  • 我刚刚做了这个。我现在只有模拟器用于测试。是否应该用鼠标单击并拖动来移动图像?它没有。但是,当我双击时,它会缩放图像。
  • 看起来缩放图像不会调整图像大小。所以很多图像在放大时都会被裁剪掉(来自我的双击测试)。你知道有什么库可以在捏时调整图像大小吗?我找不到一个。他们都说捏缩放。不捏调整大小/缩放。谢谢
  • 我可以使用这个库保存放大的图像吗?
  • @user2602079 捏缩放和捏缩放有什么区别?
【解决方案2】:

http://www.codeproject.com/Articles/319401/Simple-Gestures-on-Android

试试这个库,它真的很神奇,它提供了令人惊叹的平滑度和非常易于使用的 pich 缩放旋转

【讨论】:

    【解决方案3】:

    您可以在下面找到由 Jason Polites 创建的类的链接,该类将允许您处理自定义 ImageView 上的捏合缩放:https://github.com/jasonpolites/gesture-imageview

    只需将此包包含到您的应用程序中,然后您就可以在 XML 文件中使用自定义 GestureImaveView

    <LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:gesture-image="http://schemas.polites.com/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    
    <com.polites.android.GestureImageView
        android:id="@+id/image"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:src="@drawable/image"
        gesture-image:min-scale="0.1"
        gesture-image:max-scale="10.0"
        gesture-image:strict="false"/>
    

    这个类处理捏缩放,但也可以双击。

    【讨论】:

    猜你喜欢
    • 2012-05-24
    • 2014-01-28
    • 1970-01-01
    • 2012-10-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多