BrowserTools.Screenshot.GetWindowVisibleArea C# (CSharp) Метод

GetWindowVisibleArea() статический приватный Метод

static private GetWindowVisibleArea ( WindowInfo wi, Screen s ) : int
wi WindowInfo
s System.Windows.Forms.Screen
Результат int
        static int GetWindowVisibleArea(WindowInfo wi, Screen s)
        {
            WindowBorderOnScreenFlags flags = new WindowBorderOnScreenFlags(wi, s);

            int visibleWidth  = 0;
            int visibleHeight = 0;

            if (flags.leftBorderOnScreen)
                visibleWidth = flags.rightBorderOnScreen ? wi.rcWindow.right - wi.rcWindow.left : s.WorkingArea.Right - wi.rcWindow.left;
            else if (flags.rightBorderOnScreen)
                visibleWidth = wi.rcWindow.right - s.WorkingArea.Left;

            if (flags.topBorderOnScreen)
                visibleHeight = flags.bottomBorderOnScreen ? wi.rcWindow.bottom - wi.rcWindow.top : s.WorkingArea.Bottom - wi.rcWindow.top;
            else if (flags.bottomBorderOnScreen)
                visibleHeight = wi.rcWindow.bottom - s.WorkingArea.Top;

            return visibleWidth * visibleHeight;
        }