/// <summary>
        /// Handles the GestureRecognized event of the g control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="KinectSkeltonTracker.GestureEventArgs"/> instance containing the event data.</param>
        //private void Gesture_GestureRecognized(object sender, GestureEventArgs e)
        private void OnGestureRecognized(object sender, GestureEventArgs e)
        {
            if (this.GestureRecognized != null)
            {
                this.GestureRecognized(this, e);
            }

            foreach (Gesture g in this.gestures)
            {
                g.Reset();
            }
        }
Beispiel #2
0
 private void OnGestureRecognized(object sender, GestureEventArgs e)
 {
     Debug.WriteLine(e.GestureType);
     framesCount=0;
     switch (e.GestureType)
     {
         case GestureType.WaveLeft:
             Gesture = "WaveLeft";
             //1,0
             if (devices[0].IsSwitchedOn)
                 devices[0].switchOff(comm);
             else
                 devices[0].switchOn(comm);
             break;
         case GestureType.SwipeUp:
             Gesture = "SwipeUp";
             //2,9
             if (!devices[1].IsSwitchedOn)
                 devices[1].switchOn(comm);
             break;
         case GestureType.SwipeDown:
             Gesture = "SwipeDown";
             if(devices[1].IsSwitchedOn)
             devices[1].switchOff(comm);
             break;
         case GestureType.SwipeLeft:
             Gesture = "SwipeLeft";
             break;
         case GestureType.SwipeRight:
             Gesture = "SwipeRight";
             break;
         case GestureType.JoinedHands:
             Gesture = "JoinedHands";
             break;
     }
 }
Beispiel #3
0
        private void OnGestureRecognized(object sender, GestureEventArgs e)
        {
            Debug.WriteLine(e.GestureType);
            framesCount = 0;
            switch (e.GestureType)
            {
            case GestureType.WaveLeft:
                Gesture = "WaveLeft";
                //1,0
                if (devices[0].IsSwitchedOn)
                {
                    devices[0].switchOff(comm);
                }
                else
                {
                    devices[0].switchOn(comm);
                }
                break;

            case GestureType.SwipeUp:
                Gesture = "SwipeUp";
                //2,9
                if (!devices[1].IsSwitchedOn)
                {
                    devices[1].switchOn(comm);
                }
                break;

            case GestureType.SwipeDown:
                Gesture = "SwipeDown";
                if (devices[1].IsSwitchedOn)
                {
                    devices[1].switchOff(comm);
                }
                break;

            case GestureType.SwipeLeft:
                Gesture = "SwipeLeft";
                break;

            case GestureType.SwipeRight:
                Gesture = "SwipeRight";
                break;

            /* case GestureType.JoinedHands:
             *   Gesture = "JoinedHands";
             *   break;*/
            case GestureType.Menu:
                Gesture = "Menu";
                break;

            /*case GestureType.ZoomIn:
             *  Gesture = "Zoom In";
             *  break;
             * case GestureType.ZoomOut:
             *  Gesture = "Zoom out";
             *  break;*/
            case GestureType.JoinedZoom:
                Gesture = "Joined Zoom";
                break;
            }
        }