コード例 #1
0
        /// <summary>
        /// Event handler for gesture recognition.
        /// </summary>
        /// <param name="sender">Source kinect gesture recognition api instance.</param>
        /// <param name="recognitionInfo">Info about recognition.</param>
        private void Players_GestureRecognized(object sender, GestureEventArgs recognitionInfo)
        {
            timer.Stop();
            gestureInfo.Content = recognitionInfo.Gesture.Name;
            if (recognitionInfo.IsValid)
                gestureInfo.Foreground = Brushes.Green;
            else
                gestureInfo.Foreground = Brushes.Red;

            gestureProbability.Content = String.Format(
                "Probability: {0:0.0} \nPlayer: {1} \nLength: {2} \nValid: {3}",
                recognitionInfo.Probability,
                recognitionInfo.SourcePlayer.Index,
                recognitionInfo.Length,
                recognitionInfo.IsValid.ToString()
            );
            gestureHistoryListBox.Items.Insert(0, recognitionInfo);
            timer.Start();
        }
コード例 #2
0
 /// <summary>
 /// Called when gesture is recognized.
 /// </summary>
 internal void OnGestureRecognized(GestureEventArgs e)
 {
     if (GestureRecognized != null)
         GestureRecognized(this, e);
 }
コード例 #3
0
 private void KinectGesturePlayerCollection_GestureRecognized(object sender, GestureEventArgs e)
 {
     //propagete event into API class
     api.OnGestureRecognized(e);
 }