Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use the Touch Gestures

28 views
Skip to first unread message

Pablo

unread,
May 27, 2010, 4:21:34 PM5/27/10
to
Hi, i'm starting to play with my touch screen with micro framework 4.0. While
i can catch the press down & up event, move event, and even some TouchGesture
Event like (left, right, up, down and diagonal moves), i'm not able to catch
let's say multitouch events (like pan, rotate,zoom). Do you have any example
on how to do this?
Here's a chunk of code:

public Window CreateWindow()
{
// Create a window object and set its size to the
// size of the display.
mainWindow = new Window();
mainWindow.Height = SystemMetrics.ScreenHeight;
mainWindow.Width = SystemMetrics.ScreenWidth;

Microsoft.SPOT.Touch.Touch.Initialize(myApplication);

// Add the text control to the window.
_stackPanel = new StackPanel(Orientation.Vertical);

Rectangle rect = new Rectangle(260, 130);
rect.Stroke.Thickness = 2;
rect.Stroke.Color = Microsoft.SPOT.Presentation.Media.Color.Black;
rect.TouchDown += new TouchEventHandler(rect_TouchDown);
rect.TouchMove += new TouchEventHandler(rect_TouchMove);
rect.TouchGestureChanged += new
TouchGestureEventHandler(rect_TouchGestureChanged);

_stackPanel.Children.Add(rect);


void rect_TouchGestureChanged(object sender, TouchGestureEventArgs e)
{
Debug.Print("TOUCH GESTURE CHANGED EVENT");
Debug.Print("TYPE: " + e.Gesture.ToString());
}


Thanks in advance!
Pablo

Lorenzo Tessiore

unread,
May 27, 2010, 4:55:53 PM5/27/10
to
Hello Pablo,

multi-touch events are implemented only in the emulator, the InkCanvas
sample explains how to use them in teh readme file.


The sample supports the following actions:
Rotate -- CTRL+R + mouse left-click and drag
Zoom In -- CTRL+Z + mouse left-click and drag
Pan Out -- CTRL+P + mouse left-click and drag
For Zoom and Pan, dragging up or right makes the image bigger.
Dragging
down or left makes the image smaller.

I am not aware of any HW so far that supports multi-touch


Regards
Lorenzo

0 new messages