Пример #1
0
        private void controller_FaceMove(object sender, FaceEventArgs e)
        {
            int x = (int)(e.X * 20f);
            int y = (int)(e.Y * 20f);

            tbHorizontal.Value = Math.Min(Math.Max(x, tbHorizontal.Minimum), tbHorizontal.Maximum);
            tbVertical.Value = Math.Min(Math.Max(y, tbVertical.Minimum), tbVertical.Maximum);

            pointBox1.PointX = e.X;
            pointBox1.PointY = e.Y;
        }
Пример #2
0
 /// <summary>
 ///   Called when a head movement is detected.
 /// </summary>
 protected virtual void OnFaceMove(FaceEventArgs args)
 {
     if (FaceMove != null)
     {
         if (SynchronizingObject != null &&
             SynchronizingObject.InvokeRequired)
         {
             SynchronizingObject.BeginInvoke(
                 FaceMove, new object[] { this, args });
         }
         else
         {
             FaceMove(this, args);
         }
     }
 }
Пример #3
0
        /// <summary>
        ///   Called when a face enters the scene.
        /// </summary>
        protected virtual void OnFaceEnter(FaceEventArgs args)
        {
            IsTracking  = true;
            IsDetecting = false;

            if (FaceEnter != null)
            {
                if (SynchronizingObject != null &&
                    SynchronizingObject.InvokeRequired)
                {
                    SynchronizingObject.BeginInvoke(
                        FaceEnter, new object[] { this, args });
                }
                else
                {
                    FaceEnter(this, args);
                }
            }
        }
Пример #4
0
 /// <summary>
 ///   Called when a head movement is detected.
 /// </summary>
 /// 
 protected virtual void OnFaceMove(FaceEventArgs args)
 {
     if (FaceMove != null)
     {
         if (SynchronizingObject != null &&
             SynchronizingObject.InvokeRequired)
         {
             SynchronizingObject.BeginInvoke(
                 FaceMove, new object[] { this, args });
         }
         else
         {
             FaceMove(this, args);
         }
     }
 }
Пример #5
0
        /// <summary>
        ///   Called when a face enters the scene.
        /// </summary>
        /// 
        protected virtual void OnFaceEnter(FaceEventArgs args)
        {
            IsTracking = true;
            IsDetecting = false;

            if (FaceEnter != null)
            {
                if (SynchronizingObject != null &&
                    SynchronizingObject.InvokeRequired)
                {
                    SynchronizingObject.BeginInvoke(
                        FaceEnter, new object[] { this, args });
                }
                else
                {
                    FaceEnter(this, args);
                }
            }
        }