Is it possible to create a behavior for Pinch and zoom to Image control in windows phone 8. I am trying to apply pinch and zoom along with rotation to Image in my application. In a forum I found that Gesture listener is deprecated and they are not promoting implementation with gesture. So can any one please suggest an alternative method for me.
If you're targeting only Windows Phone 8 you can use the new ManipulationDeltaEventArgs.PinchManipulation property from the ManipulationDelta event. Instead of using GestureListener/TouchPanel for pinch & zoom you should rely on this new property.
Maybe this could help you https://multitouch.codeplex.com/
Windows Phone / Silverlight Behaviors and WPF samples implementing Multi-Touch Manipulation (Gestures) and Inertia.
Related
I want to capture the rotate gesture of an object in my Windows Phone app and animate the object to show that it has roatated.
I saw that WP7 doesn't give this gesture by default and i dint get the same in Toolkit as well. Can anyone help me get started.
You could try using the Multitouch behavior for the Windows Phone.
The tool kit is available here:
http://multitouch.codeplex.com/
And these links might help you understand it better:
http://www.windowsphonegeek.com/tips/gestures-in-wp7-the-basic
http://dotnetslackers.com/articles/silverlight/Windows-Phone-7-Silverlight-Programming-MultiTouch-and-Manipulation.aspx
Something like dragging and dropping an image
Is there a basic sample that I can use for that purpose?
You can use OnManipulationStarter, OnManipulationDelta and OnManipulationCompleted events with TranslateTransform on some object to move it below your finger.
Also, advanced stuff will be MultiTouch Behavior for Windows Phone 7
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.
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.
I am looking for a solution where I am able to do all the gestures (flick, pinch, drag) with a local picture in my Windows Phone 7 application with acceptable performance. The Silverlight Bing Map control for WP7 does all of this perfectly, but it cannot do this with a local image.
I started to write my own control, but I was wondering if there is anything out there written by someone else. Is there anything out there?
Is it possible to reuse the Map control, but with my own image?
Laurent Bugnion's Multitouch Behaviour from beta might also be worth a look for this purpose.
MultiTouch Behavior for Windows Phone 7
MultiTouch Behavior: Update for Windows Phone 7 tools beta
You need a MultiScaleImage. You can use this with DeepZoom.
There's an (old) example here.