コード例 #1
0
ファイル: ScreenHelpers.cs プロジェクト: emilppp/kex
        /// <summary>
        /// Gets the Game View window's top left Position.
        /// </summary>
        /// <remarks>Overridden in test project. Do not remove without updating tests.</remarks>
        protected virtual Vector2 GetWindowPosition()
        {
            var windowPosition = new Win32Helpers.POINT();

            Win32Helpers.ClientToScreen(_hwnd, ref windowPosition);
            return(new Vector2(windowPosition.x, windowPosition.y));
        }
コード例 #2
0
ファイル: ScreenHelpers.cs プロジェクト: emilppp/kex
        /// <summary>
        /// Gets the Game View window's bottom right corner Position.
        /// </summary>
        /// <remarks>Overridden in test project. Do not remove without updating tests.</remarks>
        protected virtual Vector2 GetWindowBottomRight()
        {
            var clientRect = new Win32Helpers.RECT();

            Win32Helpers.GetClientRect(_hwnd, ref clientRect);

            var bottomRight = new Win32Helpers.POINT {
                x = clientRect.right, y = clientRect.bottom
            };

            Win32Helpers.ClientToScreen(_hwnd, ref bottomRight);

            return(new Vector2(bottomRight.x, bottomRight.y));
        }