The samples are included in the Surface Code Samples.zip file that is installed into the %ProgramFiles%\Microsoft SDKs\Surface\v1.0\Samples folder. A link to this ZIP file also appears on the Start menu under Microsoft Surface SDK 1.0 SP1 -> Samples. Extract the contents of ZIP file to a directory where you have write permissions.
A batch file called InstallSamples.bat is included in the ZIP file. In Windows Explorer, right-click the batch file, and then click Run as administrator. The batch file builds each SDK sample and creates the XML file needed to register the application with Surface Shell. It then copies the XML file to the correct directory so it will show up in Launcher.
After the batch file is finish, do one of the following:
If the batch file fails, check to see that it is not being run directly from the ZIP directory and that it is being run as administrator. Alternatively, open SDKSamples.sln in Microsoft Visual C# 2008 Express Edition (or Microsoft Visual Studio 2008) and install the built samples manually to the Surface Shell.
This sample demonstrates how to activate one application from another Microsoft Surface application.
This sample shows how to:
This sample shows how to use the following Core Interaction Framework state machines:
It also demonstrates the following animations:
The key classes from the Core Interaction Framework are UIController and UIElementStateMachine. The key classes from the XNA Framework are Game, GameComponentCollection, and DrawableGameComponent. The key class of the Cloth sample is the UIElement class, which derives from DrawableGameComponent and encapsulates a UIElementStateMachine object.
You can add extra controls to this sample application by using Microsoft Expression Blend 2. You can also use Expression Blend 2 to view the XAML and C# code.
The Finger Fountain sample application displays small images when it receives a Microsoft Surface contact event. Each image then shrinks and finally disappears after a certain amount of time passes.
The Fractal Browser sample application displays an H-fractal. A user can zoom the image to be larger than the Microsoft Surface screen and can rotate and pan the content.
The Grand Piano sample demonstrates how to integrate sound into Microsoft Surface applications based on the Presentation layer.
The Item Compare sample application represents a simple tool that lets a user compare and contrast the properties of two "items" (tagged objects). The items could be anything—different products for sale in a store, business cards for different companies, or anything else where a user might want to compare one thing with another.
You can place a tagged object on this sample application. If you configure the application to recognize the tag value (by using the XML file that is included with the sample), the application shows information about the object (which is also configured in the XML file).
If you place a second tagged object on the application, it shows a table that enables side-by-side comparison of the two objects. You can move and resize the table by moving the tagged objects.
The Item Compare sample application is a sample of a tag-driven application for Microsoft Surface. For more information about how to design a tag-driven application, see Designing Tag-Driven Applications for Microsoft Surface.
You must construct your own tagged objects to work with the Item Compare application. Item Compare gives you complete run-time control over the physical configuration of the tagged objects, but the default configuration that is included with the sample application assumes a particular object shape, tag placement, and set of tag values.
Because the Item Compare application distinguishes only a relatively small number of objects, this sample application uses byte tags instead of identity tags. (For more information about choosing between byte tags and identity tags, see Tagged Objects.) However, you can modify this application to use identity tags instead of byte tags by following the comments in the application's source code that identify where you must modify the code to use identity tags instead.
Item Compare assumes that a tagged object is the same size and shape as a standard business card: a rectangle that is 3.5 inches wide and 2 inches high. The application also assumes that the byte tag is located in the center of the card. The following illustration shows the back of the card with the byte tag in the proper position and orientation. The label (1) denotes the three white guide circles of the byte tag.
By default, Item Compare recognizes three byte tag values: 0xC1, 0xC2, and 0xC3.
The Item Compare sample is integrated with the Surface Shell’s object routing feature. When you install the Microsoft Surface SDK sample applications, the installation batch file completes the necessary steps to integrate the Item Compare application work with object routing.
The Notifications sample demonstrates how to display messages to the user, whether your application is currently active or is running in the background.
The Paddle Ball sample application shows how to use Microsoft Surface multitouch capability to enable up to four users to participate in a game simultaneously.
This sample application shows how to:
The Photo Paint sample demonstrates some of the user scenarios made possible by using the SurfaceInkCanvas control. Some of these include using your fingers to write, draw, erase, paint over photos, and so on.
This sample shows how to use the SurfaceInkCanvas control to:
The RawImage Visualizer sample application demonstrates how to use RawImage APIs for Microsoft Surface applications that use the Microsoft XNA development platform. This sample application displays captured normalized (8 bit per pixel) images that are flipped vertically.
This sample application demonstrates how to:
You can retrieve two types of images by using the RawImage APIs:
This sample application captures every frame of RawImage, scales the image, and flips the image vertically before it renders the image. The image is flipped vertically so it does not obscure an image from behind a contact.
The ScatterPuzzle sample application shows an implementation of the ScatterView and SurfaceListBox controls to create a simple puzzle game. The ScatterView and SurfaceListBox controls automatically provide some powerful Microsoft Surface-related features.
The Shopping Cart sample application shows how to implement drag-and-drop functionality in a retail application.
You can drag items, one or more at a time, to the gray canvas from the list. You can also resize, rotate, or move the ScatterViewItem controls.
The Tag Visualizer Events sample application shows how to implement hit-testing functionality to allow UI elements to react when tagged objects move over them.
You can place any tagged object on the application, which will display a red "glow" visualization around the tag. When the tagged object moves over one of the UI elements in the application, the visualization reacts (becomes smaller and partially transparent), as does the UI element (which shows a red highlight).
The XNA Scatter sample demonstrates how to use the manipulation and inertia processors in a Microsoft XNA application.
This sample implements behavior that is similar to the ScatterView control but in an XNA application.