I'm trying to figure out how to implement pinch-to-zoom functionality. My problem is I'm not sure how to do it algorithmically.
I have the pinch positions of both fingers and the amount they've moved since the last frame. At first I tried making the pinch amount the delta of the distance between the two fingers however every way I've done it around this concept has been unyieldly.
Even if I manage to get the pinching working semi-decently I still have the problem of the zoom direction and how to make the image zoom in on the center of the pinch area...
Is there a proper way of implementing such functionality?
I also recommend reading this, a really well implemented "gold standard" pinch:
http://adtsai.blogspot.com/2010/09/pinch-zooming-using-xna4-on-wp7-getting.html
It also makes reference to a pinch to zoom add-in so you can test pinching on the emulator with just a mouse.
What you want to do is use the built-in gesture API (specifically Pinch and PinchComplete). That way, you can take advantage of the heuristics that the xna/wp7 team has already built in. Your app will feel "more native" this way because it will react like the rest of the OS in reaction to a pinch gesture.
Nick Gravelyn has a great intro to the gesture API here:
http://blogs.msdn.com/b/nicgrave/archive/2010/07/12/touch-gestures-on-windows-phone-7.aspx
I found few links of 3rd-party solution...
1) Dual-Touch SDK for Resistive Screens V1.0 Beta, Rotation Alpha
2) SciLor's HD2 / Leo Multitouch .NET CF DLL
I tried using Dual-Touch SDKs which were working fine for Resistive screen mobiles but not for Capacitive Screen mobiles.
Related
In an iOS app I've seen that swiping with three fingers from top to bottom triggers an action.
I'm trying to do the same but even cross platform.
Since the gesture topic seems to be an ingoing development at Xamarin, I would like to ask if this gesture recognition is already built-in in the current Xamarin.Forms version (and cross-platform), or if I have to use a third party solution or try to program it myself.
I haven't been able to find a clear statement as the discussions and projects are so widely spread and perhaps not up to date anymore.
I created a small sample to how to add swipe gesture in Xamarin forms take a look on this. https://github.com/ricardoromo/SwipeGestureEffectXF, if you have any question feel free to ask.
I’m working with an Image control and I’m trying to implement pinch-zoom and panning.
None of the ready-to-go samples on the web, which handles the zoom and pan, worked as smoothly as the native Photos app on Windows Phone or like when viewing an image in Internet Explorer.
This led me to implement my own way of handling them which included me trying the following ways: (Scaling works as of now and I’m trying to get the panning to work too)
Putting the Image inside a ViewportControl; resulted in incredibly jerky scaling, but panning works smoothly. Setting UseOptimizedManipulationRouting="False" on the image didn't make a difference.
Putting the Image inside a ScrollViewer; scaling doesn't even work and panning is glitchy (jerky sometimes).
Using only the Image control and making use of animations to handle the smooth panning.
I haven't implemented step 3 yet, because I can't shake the feeling I've missed something. How can something so widely used be this hard to implement? :|
So my question is
What do I need to do to implement pinch-zoom and panning as smooth as in the Photos app?
If animations are the way to go can they be used to smooth scaling and translations to match that of the native experience?
I have created an augmented reality application using Monodroid and it works fine on a technical basis. However, the graphics I used were drawn on a canvas and are really too slow.
The application is a simple heads-up compass and speed display a-la luke-skywalkers binoculars.
I am trying to get a camera preview going with an openGL translucent/transparent overlay and yes, I have read whats available but its all pure Android SDK / Java.
Does anyone know of a method of getting this effect in C# and Monodroid possibly using the AndroidGameView? Whatever I do I can see one or the other but never both at the same time.
Unhelpful jerks are a pleasure to work with.
http://bobpowelldotnet.blogspot.fr/2012/10/monodroid-camera-preview-as-opengl.html
I am creating a web application targeted for windows phone 7.5(Mango) with a map(Google or Bing which one will work best for me). It seems panning through swap and zoom through pinch is not working for google map and bing map. Pan and zoom works through buttons provided on the map. I need to know that there is work around to provide zoom through pinch or it is the mango limitation.
Thanx
This isn't going to work I'm afraid. When you pinch or pan within the WP7 browser, these interactions are translated into pinch / pan on the browser 'surface'. As a result, the JavaScript within the page does not receive these events. The only way to support this would be to 'intercept' the manipulation events, then feed that to the JavaScript code on the web-page (as described in this blog post). However, this requires native code - so isn't much good for a purely web-app.
I'm seeing very spotty/unresponsive behavior with the silverlight map control on Windows Phone 7 (Microsoft.Phone.Controls.Map). The map control doesn't seem to pick up a lot of my pinch gestures. Is anyone else seeing this? Is there a way a workaround?
Just as an experiment I hooked up custom gesture listeners to PinchStarted, PinchDelta and PinchCompleted. My event handlers are getting fired every time I pinch, but the Silverlight map control doesn't pick them "most" of the times.
PS. I'm using the most up to date SDK/Toolkits.
After talking to our Microsoft contact we have no answers for the pinch performance problems. The official side stepped our question but and recommend putting a +/- buttons on the map for zooming in and out of the Map. To show the +/- buttons use the ZoomBarVisible property.