Introduction to Windows Surface for multi-touch

Source: Internet
Author: User
Tags windows surface

I recently studied Windows Surface. cool is very cool. I think this is a good thing Microsoft is fighting against Apple. This is a desktop program, you can use the Windows 7 Operating System (I know that Windows 7 itself supports multi-touch operations ~~~ Khan)

The Surface is presented to users based on the WPF technology. You can think about the screens that can be touched on our Tea Machines, TV walls, face masks, and anti-theft doors in the future, that would be a great life. Next let's take a look at some Surface videos.

Http://www.tudou.com/programs/view/09jtf6d0kUs/

You can search for more videos.

As a matter of fact, I will not be so embarrassed to introduce more technologies here. There will be a lot on the Internet. I like to use the ScatterView control. You can drag, zoom in, and rotate desktop photos, videos, and documents at will. The official Surface 2.0 SDK contains Code Simple, which will introduce various controls and use cases.

If you want to try it out on Windows 7 and VS2010, the rest is to download a Surface SDK and the Surface Runtime.

------------------- The following content is a reprinted Gnie
For more information, see his blog. However, there are currently too few learning materials. We suggest you understand it. If you want to do a project, consider it carefully -----------------

In previous blog posts, I have introduced how to use WPF 4 to develop applications with Multi-point Touch screen function. For more information, see Multi-Touch.
Development Resource summary. In those articles, both simple drag-and-drop operations and complex rotation and scaling effects (Manipulating) must be compiled by developers one by one. Surface
The release of the 2.0 SDK makes this work easier, and we don't even need to write any code for this effect.

This article describes how to use the ScatterView control to implement the above functions. Because the touch screen technology is only supported in Windows 7, XP users must upgrade to Windows 7. First, install the Surface 2.0 SDK and Runtime on Windows 7. You can download the installation program from the official page. After the installation is complete, open VS2010
Create a Surface 2.0 project. Select Surface Appliction (WPF) in the template ).

We can add a Label control in the current XAML code. After F5 is run, the Label control cannot perform Manipulating.

<S: SurfaceWindow x: Class = "ScatterView. surfaceWindow1 "xmlns =" http://schemas.microsoft.com/winfx/2006/xaml/presentation "xmlns: x =" http://schemas.microsoft.com/winfx/2006/xaml "xmlns: s = "http://schemas.microsoft.com/surface/2008" Title = "ScatterView"> <Grid> <Label Content = "Surface 2.0" Foreground = "Fuchsia" FontWeight = "Bold"/> </Grid> </ s: surfaceWindow>

Next, add a ScatterView control to the Grid. We can think of ScatterView as a container that can contain other controls, and these controls can achieve Manipulating effect. For example, we add three controls in ScatterView: Rectangle, Label, and SurfaceTextBox. Some may ask why Rectangle should be placed in ScatterViewItem? In fact, all controls in ScatterView are automatically added to ScatterViewItem by default, so you can set ScatterViewItem
The control is omitted. In this example, I need to manually write the ScatterViewItem control to adjust the Deceleration value of the Rectangle and adjust the Deceleration parameter.

<Grid> <s: ScatterView x: Name = "mainScatterView"> <s: scatterViewItem Deceleration = "50"> <Rectangle Fill = "Green" Width = "200" Height = "100"/> </s: scatterViewItem> <Label Content = "Surface 2.0" Foreground = "Fuchsia" FontWeight = "Bold"/> <s: surfaceTextBox Width = "500" Height = "20" FontSize = "20"/> </s: ScatterView> </Grid>

After the above Code is completed, F5 runs again. How do you feel? Does the Manipulating effect become very simple ......

If necessary, the control can be automatically loaded to ScatterView. The following code will automatically add a local image to the program.

Private void AddDemoPic () {string targetPic = @ "C: \ Users \ Public \ Pictures \ Sample Pictures \ Koala.jpg"; ScatterViewItem item = new ScatterViewItem (); mainScatterView. items. add (item); MediaElement pic = new MediaElement (); item. content = pic; item. background = Brushes. transparent; if (System. IO. file. exists (targetPic) {pic. source = new Uri (targetPic);} else {item. content = "Picture not found ";}}

So far, the introduction to ScatterView in this article is here. You are welcome to exchange ideas with each other.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.