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
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