示例#1
0
 private void Window_Reset(object sender, KeyEventArgs e)
 {
     // Resets the selected theme and page, because there is no gesture.
     if (e.Key == Key.R)
     {
         Theme        = ThemeKeys.Main;
         SelectedPage = 0;
     }
 }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            // Default to first theme
            Theme = ThemeKeys.Main;
            // Default to first page
            SelectedPage = 0;

            //Emgu.CV.Matrix<double> test = new Emgu.CV.Matrix<double>(5,5,1);
            trackingMapper = new Dictionary <int, TrackingData>();
        }
示例#3
0
        private void OnJumpRecognized(object sender, GestureEventArgs e)
        {
            string recognizer = sender.GetType().Name;
            int    skel_id    = e.TrackingID;

            Debug.WriteLine("Recognized gesture from {0} for skeleton id {1}", recognizer, skel_id);

            Point center = e.Skel2DCenter;

            if (Theme == ThemeKeys.Main)
            {
                // Left of center
                if (center.X < RenderWidth / 2.0)
                {
                    // Left top
                    if (center.Y < RenderHeight / 2.0)
                    {
                        Theme = ThemeKeys.Space;
                    }
                    // Left bottom
                    else
                    {
                        Theme = ThemeKeys.Nature;
                    }
                }
                // Right of center
                else
                {
                    // Right top
                    if (center.Y < RenderHeight / 2.0)
                    {
                        Theme = ThemeKeys.History;
                    }
                    // Right bottom
                    else
                    {
                        Theme = ThemeKeys.Art;
                    }
                }
            }
        }