/// <summary> /// Gets the eye tracked monitor's screen bounds on the Virtual Screen. /// </summary> /// <returns> /// Rect populated with upper-left corner location (x,y), and /// screen size (width, height) in pixels on the Virtual Screen. /// </returns> public Rect GetMonitorScreenBounds() { var monitorHandle = Win32Helpers.MonitorFromWindow(Hwnd, Win32Helpers.MONITOR_DEFAULTTONEAREST); var monitorInfo = new Win32Helpers.MONITORINFO(); monitorInfo.cbSize = Marshal.SizeOf(monitorInfo); Win32Helpers.GetMonitorInfo(monitorHandle, ref monitorInfo); var rc = monitorInfo.rcMonitor; return(new Rect(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top)); }