I have a following problem -
I am developing an application and i decided for the GLSurfaceView because i needed openGl for a better and more natural page curl animation.
Having achieved that, now i find myself in a bit of a problem, since i cannot find a tutorial of any kind to implement pinch zoom on GLSurfaceView. I captured the event, the distances between fingers, scale, etc... But i do not know how to perform the actual transformation.
I found the one transforming ImageView via matrix, but alas...
Anyone done pinch zooming in openGl?
I don't think there is any need to post the code, but i will do it if it will nelp you in answering.
you can use the concept of scalegesturedetector to implement Pinch zoom , refer http://android-developers.blogspot.com/2010/06/making-sense-of-multitouch.html
Related
I am implementing a simple paint application (Finger paint android). I would like to use two fingers for both scaling and zooming. Should I use different listeners and detectors for both. The problem is that when i try to scroll with two fingers zooming kicks in and the screen just jumps. Can you please point me to implementations.
Thanks
You can use ScaleGestureDetector to easily detect things like pinch-to-zoom. Go through this Android developers blog post for a detailed explanation.
I am developing a RDP application using android 3.0. I am using surface view to display the images. Is there any way to implement pinch zoom functionality for surface view(I am trying to zoom the image).
Subclass surfaceview and implements onTouchEvent(). Use a GestureDetector and GestureListener to modify a matrix representing the current state of manipulation and draw your canvas modified by this matrix.
It works, but is a piece of software to figure out. Took me around 6 weeks to have everything set up correctly, especially if you want some overlay items which also listen to touch events. I'd think about publishing that code, but it's company code...
I've a running graph library developed with onDraw plotting the graph using canvas.drawLine methods. In onTouch I've implemented scroll functionality.
Now my customer wants Zoom/Pinch. Is it possible to perform zoom/pinch on such a view without redrawing for these operations?
What is the best way to implement this?
Now next..
How can I display Zooming indicators for this??
I've some how managed to display scale of zoom (scaleFactor * 100). How will I show a zooming indicator? I can display static images using canvas.drawBitmap. But is there a more better way?
Any help is appreciated
Add a pinch zoom capability to the graph:
How to implement pinch zoom refer : android pinch zoom
I implemented a custom android SurfaceView class which draw (onDraw method) something often bigger than the available device width and height. When the user toutch the screen and move it's finger I need to implement a kind of picture movement with a speed and direction matching the speed and direction given by the user. That part I'm able to do it within onTouchEvent method. But here is my question: now I also want the speed to decelerate progressivly. I think this probably have to be coded with DecelerateInterpolator... Is there some samples or demos somewhere involving a SurfaceView, onTouchEvent and DecelerateInterpolator... ?
I was thinking of a too complicated way to address the problem. Finally found a way to solve my problem here: Smooth scrolling in Android The OnGestureListener simplify all gestures management.
I got frustated with zooming and panning issue of an image in android.I dont want to use sony zoom tutorial because i need zoom from buttons.
can anybody suggests me or provide me code to zoom an image with simple matrix calculation.
please do needful.