android - 在 Android 上进行缩放和平移图像叠加的最佳方式?

标签 android image opengl-es zooming pinch

我是 Android 开发的新手,我目前正在开发一个应用程序,该应用程序需要一个可缩放和平移的图像,该图像将在其上叠加其他图像,类似于 MapView 但不使用 Google map API。

我看了看,发现我可以通过执行这个问题中的方法来完成覆盖部分:Draw images on top of each other in android

但是,我不知道这是否可以实现双指缩放和/或平移大图像的能力。创建一个 GLSurfaceView 并仅实现所需的功能是否值得,还是因为我要重新发明轮子而这样做是否过大?

就其值(value)而言,大 map 图像本身将从服务器获取(但如果需要,可以将其拆分为更小的方形区域),并且将覆盖在 map 上不同位置的图标将嵌入到应用本身。

最佳答案

Sony Ericsson 制作了一个出色的 PinchZoomable ImageView 类。我根据需要修改了它。我合并了他们的双指缩放和单点触控缩放(适用于没有多点触控的手机)http://code.google.com/p/motivatormaker-android/source/browse/MakeMotivator/src/com/sonyericsson/zoom/ImageZoomView.java

他们的教程在这里:http://developer.sonymobile.com/2011/04/12/how-to-take-advantage-of-the-pinch-to-zoom-feature-in-your-xperia-10-apps-part-2/

我在不需要使用 OpenGL 的情况下使用这些类获得了相当不错的性能。

关于android - 在 Android 上进行缩放和平移图像叠加的最佳方式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9144914/

相关文章:

java - 具有动态数字列和行的 Android 表格 View

java - 访问其他 Java Activity 时静态字符串变量不会改变

android - 是否可以使用 Z 坐标使 Android 游戏在多种屏​​幕尺寸上兼容?

android - eglCreateWindowSurface 因 java.lang.IllegalArgumentException 而失败

java - OpenGL ES : Using Texture: Blank White instead of Texture Image

java - Android - 可打包 | putParcelableArrayListExtra ("ListItems", listItems);

android - 迁移到 androidx 后,膨胀类 androidx.constraintlayout.ConstraintLayout 时出错

android - 在社交网站上上传应用程序内容

image - 缺少 Visual Studio 2012 图像库。去哪里弄一个?

android - 从 Facebook 获取个人资料图片并将其显示在 Android 应用程序中