Exemplo n.º 1
0
        /// <summary>
        /// Reset Handling Windows Pointer
        /// </summary>
        /// <param name="hWnd">current Handling Windows Pointer</param>
        public void ResetHandlingPointer(IntPtr hWnd)
        {
            HandlingPtr = hWnd;

            // If hWnd is not Zero, just set HandlingPtr
            if (hWnd != IntPtr.Zero)
            {
                return;
            }

            // If hWnd is Zero, just consider as Full Screen Capture
            Rectangle windRtg = CaptureHelper.GetWindowCoordinate(hWnd);

            ContentSetting(this, windRtg.Width, windRtg.Height);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create Screen Capture
        /// </summary>
        /// <param name="hWnd">Handling Windows Pointer</param>
        /// <returns></returns>
        public static ScreenCapture Create(IntPtr hWnd)
        {
            ScreenCapture sc = new ScreenCapture
            {
                HandlingPtr = hWnd,
            };

            // If hWnd is not Zero, just set HandlingPtr
            if (hWnd != IntPtr.Zero)
            {
                return(sc);
            }

            // If hWnd is Zero, just consider as Full Screen Capture
            Rectangle windRtg = CaptureHelper.GetWindowCoordinate(hWnd);

            ContentSetting(sc, windRtg.Width, windRtg.Height);
            return(sc);
        }