How pinch zoom image in image zoom android? [closed]
Asked Answered
D

3

16

I have to display image in an imageview. And what I want to do is just simply pinch and zoom functionality on imageview.

Deaconry answered 3/6, 2013 at 10:1 Comment(3)
Just go for link....you found some solution... #8399796Disport
#10129342Blanka
check out this answer its awesome and one line of codeAraldo
R
16

You can find below a link to a class created by Jason Polites that will allow you to handle pinch zooms on custom ImageViews: https://github.com/jasonpolites/gesture-imageview.

Just include this package into your application and then you will be able to use a custom GestureImaveView in your XML files:

<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"/>

This class handles pinch zooms, but also double taps.

Rebbecarebbecca answered 3/6, 2013 at 10:7 Comment(2)
It really helped me.. Great..Accuse
Try this gesture library it comes with an out-of-the-box pan zoom mode: bitbucket.org/warwick/hacergestov3Fuss
A
33

You can use Chrisbanes photoview library:

https://github.com/chrisbanes/PhotoView

Artis answered 3/6, 2013 at 10:14 Comment(4)
I have done this just now. I only have the emulator for testing right now. Should click and drag with the mouse move the image? It doesn't. However, when I double-click, it zooms the image.Karlsruhe
It also appears that zooming the image does not resize the image. So a lot of the image gets cropped out when it enlarges (From my double tap testing). Do you know any libraries to resize the image on pinch? I cannot find one. They all say pinch zoom. Not pinch resize/scale. ThanksKarlsruhe
Can i save the zoomed image using this library?Neomaneomah
@Karlsruhe What is the difference between pinch zoom and pinch resize?Scrophulariaceous
R
16

You can find below a link to a class created by Jason Polites that will allow you to handle pinch zooms on custom ImageViews: https://github.com/jasonpolites/gesture-imageview.

Just include this package into your application and then you will be able to use a custom GestureImaveView in your XML files:

<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"/>

This class handles pinch zooms, but also double taps.

Rebbecarebbecca answered 3/6, 2013 at 10:7 Comment(2)
It really helped me.. Great..Accuse
Try this gesture library it comes with an out-of-the-box pan zoom mode: bitbucket.org/warwick/hacergestov3Fuss
M
1

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

try this library it is really amazing it gives pich zoom rotate with the amazing smoothness and is much easy to use

Magnet answered 3/6, 2013 at 10:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.