Click here to Skip to main content
12,816,775 members (33,833 online)
Click here to Skip to main content
Add your own
alternative version


2 bookmarked
Posted 9 Sep 2009

Tagged Objects in Microsoft Surface – TagVisualizer,TagVisualization,TagVisualizationDefinition

, 17 Mar 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Article about Tag driven application or Tagged Objects in Surface SDK.

Microsoft introduced a new concept called Tag driven application or Tagged Objects in Surface SDK through which the surface can identify Objects placed over the surface table.Object is printed with some tags that surface engine can read.Tags are either Byte Tags or Identity Tags.

How we can achieve this using Surface SDK?Let’s have a look at that.
I tried a sample by using Tagged Objects in Surface SDK.

Tag Visualization is possible by using these three classes,

  • TagVisualizer – is what actually responding to the Tagged Object and showing up the TagVisualization when placing a tag.
  • TagVisualization - is what we are showing in the surface when a tag is placed in the surface.
  • TagVisualizationDefinition – is using for defining the tag value to which the TagVisualizer will respond and also source, physical location,orientation and other properties of the visualization.

So Let’s try a sample.

  • Create a Surface project from the Visual Studio 2008 Template.
  • In the SurfaceWindow1 add a TagVisualizer.
<s:TagVisualizer Name="TagVisualizer">
  • Add a TagVisualization to the project.Add New Item>TagVisualization.I created TagVisualization SampleTagVisualization,
<s:TagVisualization x:Class="MySurfaceApplication.SampleTagVisualization"          
<Grid Height="400"
<TextBlock Text="Some Tagged Object UI here."
          Foreground="Red" />
  • Add TagVisualizationDefinition to SurfaceWindow1 for TagVisualizer.We can add this either by XAML or from code behind,

Either From XAML,

<s:TagVisualizer Name="TagVisualizer">
<s:ByteTagVisualizationDefinition Value="192"
or From code behind,(add it in the constructor)
ByteTagVisualizationDefinition tagVisualizationDefinition = new 
tagVisualizationDefinition.Value = 192;
tagVisualizationDefinition.Source = new Uri("SampleTagVisualization.xaml",
tagVisualizationDefinition.UsesTagOrientation = true;
tagVisualizationDefinition.TagRemovedBehavior = TagRemovedBehavior.Fade;
tagVisualizationDefinition.PhysicalCenterOffsetFromTag = new 
Vector(7.5, 4.5);
Build and Run the application in Surface Simulator.Tag Value is here 192.So give Tag Value as C0 (Hexadecimal). 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Arun Jacob
Software Developer Tata Consultancy Services
India India
I have been working in different .NET Technologies like ASP.NET,WPF,Silverlight for the last few years.I am enjoying my life as a Programmer and spending time with my Family,Friends & Camera.

My Technical Blog

My Photo Blog

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170308.1 | Last Updated 18 Mar 2010
Article Copyright 2009 by Arun Jacob
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid