Hi,
now that we already have the Beta 2 Kinect for Windows SDK in our hands, because we see as detected when you connect or disconnect a Kinect sensor to our computer.
Tutorial
1 Create an implementation of the WPF Application type
2 Add the following references
- Microsoft.research.Kinect
< % Program Files % > \Microsoft SDKs\Kinect\v1.0 Beta2\Assemblies\Microsoft.Research.Kinect.dll
3. Then we modify our MainWindow to initialize the capture of events in the Load of the Window.
1: <Window x:Class=”ElBruno.KinectStatus.MainWindow”
2: xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”
3: xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”
4: Title=”MainWindow” Height=”350″ Width=”525″ Loaded=”WindowLoaded”>
5: <Grid>
6:
7: </Grid>
8: </Window>
4 Implement the WindowLoad() event and in the same we subscribe to the change of State that fires when you connect one or more sensors Kinect.
1: using System.Windows;
2: using Microsoft.Research.Kinect.Nui;
3:
4: namespace ElBruno.KinectStatus
5: {
6: public partial class MainWindow : Window
7: {
8: public MainWindow()
9: {
10: InitializeComponent();
11: }
12:
13: private void WindowLoaded(object sender, RoutedEventArgs e)
14: {
15: Runtime.Kinects.StatusChanged += KinectsStatusChanged;
16: }
17:
18: private void KinectsStatusChanged(object sender, StatusChangedEventArgs e)
19: {
20: MessageBox.Show(e.Status.ToString());
21: }
22: }
23: }
5. At this point already, we can compile and run our application. After connecting and disconnecting the device several times we see something similar to the following
More easy impossible right? ![]()
keep playing…
Greetings @ Home
The Bruno

Leave a comment