コード例 #1
0
        public bool IsGazeInScreenRegion(Rect region)
        {
            var gazeScreenPoint = ScreenHelpers.GetGazePointInScreenPixels(_eyetracker);

            //Logger.Log($"Gaze point: {gazeScreenPoint}");

            return(region.Contains(gazeScreenPoint));
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public Point GetRelativeGazePoint(FrameworkElement element)
        {
            var gazeScreenPoint = ScreenHelpers.GetGazePointInScreenPixels(_eyetracker);

            return(element.PointFromScreen(gazeScreenPoint));
        }