none
microsoft.research.kinect.nui; What should I do? microsoft.research.kinect. nui is not RRS feed

  • Question

  • using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Windows;

    using System.Windows.Controls;

    using System.Windows.Data;

    using System.Windows.Documents;

    using System.Windows.Input;

    using System.Windows.Media;

    using System.Windows.Media.Imaging;

    using System.Windows.Navigation;

    using System.Windows.Shapes;

     

    using Microsoft.Research.Kinect.Nui;

     

    namespace KinectHandTracker

    {

        /// <summary>

        /// Interaction logic for MainWindow.xaml

        /// </summary>

        public partial class MainWindow : Window

        {

            public MainWindow()

            {

                InitializeComponent();

            }

     

            // init

            Runtime nui;

           

     

            // code starts here!

            private void Window_Loaded(object sender, RoutedEventArgs e)

            {

                nui = new Runtime();

     

                try

                {

                    nui.Initialize(RuntimeOptions.UseSkeletalTracking);

                }

                catch (InvalidOperationException ex)

                {

                    MessageBox.Show(ex.Message);

                    return;

                }

      

                nui.SkeletonFrameReady += new EventHandler<SkeletonFrameReadyEventArgs>(nui_SkeletonFrameReady);

            }

     

            void nui_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e)

            {

                SkeletonFrame skeletonFrame = e.SkeletonFrame;

               

                foreach (SkeletonData data in skeletonFrame.Skeletons)

                {

                    if (SkeletonTrackingState.Tracked == data.TrackingState)

                    {

                        Point handPosition;

                        Joint handJoint = data.Joints[JointID.HandRight];

     

                        handPosition = new Point(handJoint.Position.X, handJoint.Position.Y);

                        handTextBox.Text =

                            string.Format("( {0:0.00}, {1:0.00} )",

                                            handPosition.X, handPosition.Y);

                    } // END IF

                } // END LOOP

            }

     

     

            private void Window_Closed(object sender, EventArgs e)

            {

                nui.Uninitialize();

                Environment.Exit(0);

            }

     

        }

    }

    give me solution : ( please

    Wednesday, May 21, 2014 4:42 AM

All replies