Copyright © Microsoft Corporation. All rights reserved.
This code is a “supplement” under the terms of the Microsoft Kinect for Windows SDK (Beta) from Microsoft Research License Agreement:, and is licensed under the terms of that license agreement.

This paint sample allows you to paint on a canvas using a pen, paintbrush, airbrush, and eraser.
It allows you to select different brush sizes and colors, and to save and load.

Use your right hand to control the cursor. Hover over a button for a second to press it.

To paint, hold your left hand up above your shoulder.

If the Kinect is not plugged in when you start the app, it will use the mouse instead.


This sample is available in the following language implementations:
Visual Basic


VisibleIfPresentConverter.cs - Converts a non-null value into Visibility.Visible, and a null value into Visibility.Collapsed
ConfirmationPopup.xaml - The popup dialog giving the user a yes/no option
LoadPopup.xaml - The popup dialog displaying the 10 most recent images created with KinectPaint
CursorStyles.xaml - A collection of styles relating to the cursor
GlobalStyles.xaml - A collection of styles used across the entire app UI
TutorialStyles.xaml - Styles used by the tutorial page
App.xaml - The basic application class
ArchivedImage.cs - Represents an image saved in My Pictures/KinectPaint that can be loaded
BitmapHelpers.cs - A set of helper functions for painting to a WriteableBitmap
BrushSelection.cs - Represents a brush that can be selected to paint with
CursorEventArgs.cs - Defines event parameters for the KinectCursor.CursorEnter and KinectCursor.CursorLeave events
FocusingStackPanel.cs - A panel similar to StackPanel that gives all children equal space except the "focused" object
KinectCursor.xaml - The cursor control that displays on the screen. Also responsible for firing CursorEnter and CursorLeave events
KinectPaintButton.cs - Derivative of Button that activates when the Kinect cursor hovers over it.
KinectPaintCheckBox.cs - Derivative of CheckBox that toggles when the Kinect cursor hovers over it.
KinectPaintListBox.cs - Derivative of ListBox that selects an item when the Kinect cursor hovers over it.
KinectPaintListBoxItem.cs - Derivative of ListBoxItem that allows KinectPaintListBox to work.
MainWindow.xaml - Top-level application UI and interaction logic
Tutorial.xaml - The tutorial UI




To build the sample using the command prompt:
1. Open the Command Prompt window and navigate to the KinectPaint directory.
2. Type msbuild KinectPaint.sln

To build the sample using Visual Studio (preferred method):
1. In Windows Explorer, navigate to the KinectPaint directory.
2. Double-click the icon for the .sln (solution) file to open the file in Visual Studio.
3. In the Build menu, select Build Solution. The application will be built in the default \Debug or \Release directory.


To run the sample:
1. Navigate to the directory that contains the new executable, using the command prompt or Windows Explorer.
2. Type KinectPaint.exe at the command line, or double-click the icon for KinectPaint to launch it from Windows Explorer.

Last edited Jun 16, 2011 at 3:25 AM by LisaBrice, version 1


mgagna Jan 15, 2016 at 9:45 AM 
I had the same problem. This is how I solved it.

The problem is the reference of the Microsoft.Kinetic assembly.

First, you need to remove the reference of the Microsoft.Kinect (Solution Explorer --> Kinect Paint --> References -->Microsoft.Kinect --> Del key)
Then you need to add the reference for the Microsoft.Kinect of your SDK version. (Solution Explorer --> Kinect Paint --> References -->Add reference --> Microsoft.Kinect, in VS2015 is in the Extensions group)

Rebuild and done!

I used VS2015 and Kinect SDK 1.8

asssagar Jun 25, 2014 at 1:57 PM 
I am getting the same error as I have to change the identity of KinectSensor somewhere?

shyam8prasad Jan 9, 2014 at 5:55 AM 
when we run the code we get error.. would you please help?

glaydson Oct 12, 2013 at 9:41 PM 
I could not compile the project. I have Visual Studio 2010, Kinect SDK 1.6, .NET 4.5

------ Build started: Project: KinectPaint, Configuration: Debug x86 ------
C:\Users\bertozzi\Documents\Visual Studio 2010\Projects\paint-76924\KinectPaint\MainWindow.xaml.cs(211,16): error CS0246: The type or namespace name 'KinectSensor' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\bertozzi\Documents\Visual Studio 2010\Projects\paint-76924\KinectPaint\MainWindow.xaml.cs(578,63): error CS0246: The type or namespace name 'AllFramesReadyEventArgs' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\bertozzi\Documents\Visual Studio 2010\Projects\paint-76924\KinectPaint\KinectCursor.xaml.cs(230,38): error CS0246: The type or namespace name 'AllFramesReadyEventArgs' could not be found (are you missing a using directive or an assembly reference?)

Compile complete -- 3 errors, 0 warnings




Time Elapsed 00:00:00.47
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========