public bool IsGazeInScreenRegion(Rect region) { var gazeScreenPoint = ScreenHelpers.GetGazePointInScreenPixels(_eyetracker); //Logger.Log($"Gaze point: {gazeScreenPoint}"); return(region.Contains(gazeScreenPoint)); }
public static bool IsLookingAt(this IEyetracker eyetracker, EnvDTE.Window window) { var gazePixels = ScreenHelpers.GetGazePointInScreenPixels(eyetracker); ThreadHelper.ThrowIfNotOnUIThread(); var x = gazePixels.X - window.Left; var y = gazePixels.Y - window.Top; return(x > 0 && x < window.Width && y > 0 && y < window.Height); }
public Point GetRelativeGazePoint(FrameworkElement element) { var gazeScreenPoint = ScreenHelpers.GetGazePointInScreenPixels(_eyetracker); return(element.PointFromScreen(gazeScreenPoint)); }