Ejemplo n.º 1
0
        public Demo()
        {
            InitializeComponent();

            // variable initialization
            isPointed = false;
            checkedButton = false;
            paused = false;
            counterFrames = 0;
            counterFramesBody = 0;
            mainHandId = 0;
            PointerMovedAssigned = false;
            MediaEndedAssigned = false;

            relatedBackup = null;

            // object initialization
            IdleAnimateFirstHand();
            kc = new KinectController();
            hue = new HueController("192.168.0.2");
            hue.Connect();
            hue.isBright = true;
            kc.bodyReader.FrameArrived += HandleFrame;

            idle = new DemoIdle();
            this.contentControl.Content = idle;
            KinectRegion.SetKinectRegion(this, kinectRegion);

            App app = ((App)Application.Current);
            app.KinectRegion = kinectRegion;

            windowProducts = new SortedList<int, Model.Product>();
            db = new DbFileManager();

            state = 1;

            playimage = new BitmapImage(new Uri("Images\\play.png", UriKind.Relative));
            pauseimage = new BitmapImage(new Uri("Images\\pause.png", UriKind.Relative));

            InitProducts();

            idle.label.Opacity = 0;

            kWin = KinectCoreWindow.GetForCurrentThread();
            if (!PointerMovedAssigned)
            {
                kWin.PointerMoved += KWin_PointerMoved;
                kWin.PointerExited += KWin_PointerExited;
                kWin.PointerEntered += KWin_PointerEntered;
                PointerMovedAssigned = true;
            }

            /*
            this.MouseMove += Demo_MouseMove;

            currentProduct = 1;
            StartTrailer(windowProducts[currentProduct].GetTrailer());
            isPointed = true;*/
        }
        /// <summary>
        /// Initializes a new instance of the MainWindow class.
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            kc = new KinectController();
            kc.bodyReader.FrameArrived += Reader_FrameArrived;
            // the offset is modified by calibration window
            offsetXBox.Text = kc.offsetX.ToString();
            offsetYBox.Text = kc.offsetY.ToString();
        }
 public CalibrationWindow()
 {
     InitializeComponent();
     kc = new KinectController();
     kc.bodyReader.FrameArrived += Calibration_FrameArrived;
 }