Now let's move towards a more complex and visually appealing application. In this application, we shall be moving five photographs (.JPEG) using multi-touch technique. The first step is to keep five photographs in 'MyPicture' folder inside 'MyDocuments'. Then create a 'WPF Application' in Visual studio 2008 and name it 'SecondMultitouch,' and then again add reference 'Multitouch.Framework.WPF.dll'. Now open 'Window1.axml' file and replace the code with:
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mt="http://schemas.multitouch.com/Multitouch/2008/04" xmlns:sys="clr-namespace:System;assembly=mscorlib" Title="Window1" Height="300" Width="300">
Save this file and then move to 'Window1.cs' file and change it to the following:
using System.Collections.ObjectModel; using System.IO; namespace SecondMultitouch { public partial class Window1 : Multitouch.Framework.WPF.Controls.Window { public Window1() { DataContext = this; Photos = new ObservableCollection(); InitializeComponent(); } public ObservableCollection Photos { get {return (ObservableCollection)GetValue(PhotosProperty); } set { SetValue(PhotosProperty, value); } }
public static readonly DependencyProperty PhotosProperty = DependencyProperty.Register("Photos",typeof(ObservableCollection), typeof(Window)); protected override void OnInitialized(EventArgs e)
{ base.OnInitialized(e); foreach (string file in Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures), "*.jpg").Take(5)) { Photos.Add(file); } }
Now we are ready with the application. Just run 'Windows.Service. Console.exe' in the back ground and then run 'SecondMultitouch' application. One can easily rotate, zoom and move pictures. This application gives a feel of a multi-touch device where the 'touching' part is done through mouse. Multi-touch is clearly futuristic and a very appealing technology that makes computing really interesting and in a way 'sensitive.'
Integrate your work force and give a fight to your Competition.
Network with 2000 software professionals and create evangelists for your products.
About CIOL | Media Kit | Site Map | Contact Us | Help | Write to us | Jobs@CyberMedia | Privacy Policy
Copyright © CyberMedia India Online Ltd. All rights reserved. Usage of content from web site is subject to Terms and Conditions.