Esempio n. 1
0
        public KinectWindow(GenderWindow.GenderType gender_type)
        {
            InitializeComponent();

            // Initialise gender_type for when constructing CalculatingWindow
            this.gender_type = gender_type;

            this.bodyTracker = new BodyTracker();

            //Initialize the Sensor
            sensor = new KinectSensorWrapper();
            sensor.startScanning();
            sensor.AllFrameCallback += sensor_AllFrameCallback; // Subscribe to Kinect Frame Callbacks

            //Initalize the Bitmap
            displayedBitmap = new WriteableBitmap(sensor.getBodyIndexFrameDescription().Width,
                                                  sensor.getBodyIndexFrameDescription().Height,
                                                  96.0, 96.0, PixelFormats.Bgr32, null);

            // Setup the timer
            countDownTimer          = new DispatcherTimer();
            countDownTimer.Tick    += new EventHandler(countDownTimer_Tick);
            countDownTimer.Interval = new TimeSpan(0, 0, 0, 1); // 1 second

            // Update the GUI
            updateControls(State.NO_BODY);
        }
Esempio n. 2
0
        private void startNextWindow()
        {
            sensor.stopScanning();
            sensor.AllFrameCallback -= sensor_AllFrameCallback;
            sensor = null;
            WaitingWindow cw = new WaitingWindow(gender_type);

            cw.Show();

            this.Close();
        }