Esempio n. 1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     grs = new GestureRecognizerStart(this);
     prs = new PostureRecognizerStart(this);
     prs.postureEventHandler += new PostureEventHandler(this.OnPostureEvent);
     kinectCtrl = new KinectControl(grs, prs);
     HCV        = MouseControl.cursor;
     full_screen.Children.Add(HCV);
 }
        public KinectControl(GestureRecognizerStart _grs, PostureRecognizerStart _prs)
        {
            // get Active Kinect Sensor
            sensor = KinectSensor.GetDefault();
            // open the reader for the body frames
            bodyFrameReader = sensor.BodyFrameSource.OpenReader();
            bodyFrameReader.FrameArrived += bodyFrameReader_FrameArrived;

            // get screen with and height
            screenWidth  = (int)SystemParameters.PrimaryScreenWidth;
            screenHeight = (int)SystemParameters.PrimaryScreenHeight;
            grs          = _grs;
            prs          = _prs;

            // open the sensor
            sensor.Open();
        }