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; }
/// <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); } } }
/// <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); } } }
/// <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); } } }
/// <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); } } }