The official Kinect SDK has been out for a while now and I haven’t seen many people actually doing “how-to” post to get others started developing for it. I decided that I would help kick-start the movement by creating a series called, “Kinecting theDots”. This is going to be a series of blog posts covering questions or concerns that I’ve seen in the community. I am planning on answering questions so if you have one that you want answered then please contact me by using the form above.

First a few post by me that will help you get started developing for Kinect. I highly recommend the first one.

How do you get create a button that can be used in your Kinect Applications? I would like my users to be able to interact with it inside of the application.

Answer:

There are a lot of ways you can implement a custom button that your user can interact with in a Kinect Application. The one that we are going to do today is part of the Coding4Fun Kinect Toolkit. This toolkit provides a button called “Hover Button”. The only problem is that some people can’t figure it out because it does not have any documentation.

Let’s get started:

Download and install the following software.

The official Kinect for Windows SDK beta – You can either download a 32 or 64 bit SDK depending on your OS. Coding4Fun Kinect Toolkit – Lots of extension methods and controls for WPF and WinForms – we are only interested in the Hover Button at this point. KinectContrib is a set of VS2010 Templates that will help you get started building a Kinect project very quickly. GUI Buttons for Active/Hover – Not required but some great sample buttons with a free license on them.

Source Code to Sample Application

If you just want the source code to this application then it is located here.

Fire up Visual Studio

Start Visual Studio 2010 SP1 and go to File-> New Project and select Windows->Kinect->KinectSkeletonApplication. You can go ahead and give it a name if you wish.

As soon as the project loads, we are going to add a reference to add a reference to the Coding4Fun Kinect Toolkit file named Coding4Fun.Kinect.Wpf.dll. You should have these files if you downloaded the Coding4Fun Kinect Toolkit mentioned earlier.

Since we are going to add some buttons to our project. Let’s go ahead and download some premade button images that have a active and inactive state. I used the pack from here.

Create a folder in your project named “Resource” and copy all of the buttons to that folder. We are only going to use one set, but you may find the others useful later. Your solution should look like this:

XAML

This template comes with a lot of code to get started already. We are simply going to add the Hover Button and it’s namespace. Our MainPage.xaml should look like the following once complete: