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
Related
I need to build a screen with map of a theater, and user can interact with zoom in/out and choose seats on map.
When user touch on a seat, the icon of seat is changed.
Is there some lib/component to build my own map with touch areas? Or some good idea to use Android API to solve this problem?
Thanks.
You should take a look at the SurfaceView API.
It provides you with an easy to use abstraction for drawing on a canvas. You can use it to render your theater image and intercept touch events on it. However, zoom in and zoom out are not supported out of the box, so you should implement them separately.
Another thing you can do is show your image in an ImageView and use scaling to implement the zoom in/zoom out, but then intercepting the exact touch position can get a little tricky.
I am currently trying to figure out which way is best to display a picture in an Android app. The picture will be a map and will be a big picture (3000x3000 pixels). I would like to add the ability to pinch zoom into the picture and move the image around the screen but not have the scale of the image changed. I have played around with a lot of solutions that when the image is moved it is auto re-sized. Is there a way of doing this? Thanks.
However I have used many libraries for loading large images but subsampling-scale-image-view is the best library I found and also it supports a variety of gesture support.
Gesture detection
One finger pan
Two finger pinch to zoom
Pan while zooming
Seamless switch between pan and zoom
Fling momentum after panning
Double tap to zoom in and out
Options to disable pan and/or zoom gestures
Supports interception of events using GestureDetector and OnTouchListener
Extend to add your own gestures
Njoy!
In my android application i want to perform the pinch zoom functionality on a view (not image view).
I also want to zoom the view-group on double-tap event.i did it by using a canvas but i think this is not the exact solution. please suggest the solution to my problem.
thanks in advance.....
In my application, I would like to add zoom functionality to my views. Like in an activity I am displaying LinearLayout etc. But as of now what I know a view can be zoomed in only in WebView and not in normal view. After all what I want is to zoom in/zoom out feature similar to WebView in my normal views.
Thanks in advance.
Construct a Custom Layout extending Liner Layout or any other. Override its onDraw function and and provide zooming functionality manually. There are many example at SO for zooming. You can follow them..
This might help:
android pinch zoom
How to apply pinch zoom on Gallery in android?
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