Microsoft is going to launch the new Windows 7 operating system in October 2009. Currently the RC version is available online. As you know, Windows 7 came up with lots of goodies including better resource management, better performance, jumplist management, multitouch functionality & many more. Here I will discuss about developing a simple multitouch application using .NET 3.5 SP1.

Before doing anything, you have to download the Windows 7 Multitouch API. You can download it from here. Extract the downloaded zip file to your local hard drive. Be sure that you are using Windows 7 & you have a multitouch enabled screen to test it out.

Create a WPF application using Visual Studio 2008. This will automatically add an XAML file named Window1.xaml for you. Now add an image to your solution directory & insert it in the XAML. Now your Window1.xaml will look something like this:

<Grid><ImageSource="images/Hydrangeas.jpg"/></Grid>

Add RenderTransform to the image so that we can scale or rotate the image properly. This will produce XAML similar to this:

Use proper names when you are adding different types of transform to the transform group. It will be easier for you to handle it from the code behind file. Run your application. This will open up your Window with an image inside it. If you want to drag or rotate the image, this will not work because we haven’t integrated the functionality yet.

Add two project references, i.e. “Windows7.Multitouch” & “Windows7.Multitouch.WPF” from the extracted zip folder to your solution. These are the managed API codes for multitouch application development.

Go to your Window1.xaml.cs and be sure that the following namespaces are already included. You may have to add some of them.

using System;
using System.Windows;
using Windows7.Multitouch;
using Windows7.Multitouch.Manipulation;
using Windows7.Multitouch.WPF;

From the ManipulationDeltaEventArgs, you can get various values and depending upon them, you can implement your functionality in this block. TranslateTransform will position the image, RotateTransform will do the rotation and the ScaleTransform will resize the image. Run your project to test your first multitouch application.CodeProject

He is currently working in an MNC located in India. He has a very good skill over XAML, C#, Silverlight, Windows Phone, WPF and Windows Store (WinRT) app development. He posts his findings, articles, tutorials in his technical blog and CodeProject.

Ok.. I have a rough idea of how it works..
So for example, if I want to include pictures and videos in my application..
I need to add in 2 more classes which are the VideoTracker and VideoTrackerManager right?

So for example, if I want to include pictures and videos in my application..
I need to add in 2 more classes which are the VideoTracker and VideoTrackerManager right?

Yeah, for time being you can use two different classes for picture & video. But I will suggest to use the same class by making it Generic. Generic classes will reduce your no. of class files & also they are easy to maintain.