Пример #1
0
        public Image Capture(Rectangle r, IntPtr handle, bool captureCursor)
        {
            if (handle.ToInt32() > 0)
            {
                Rectangle rect;

                if (CaptureClientArea)
                {
                    rect = NativeMethods.GetClientRect(handle);
                }
                else
                {
                    rect = CaptureHelpers.GetWindowRectangle(handle);
                }

                bool isTaskbarHide = false;

                try
                {
                    if (AutoHideTaskbar)
                    {
                        isTaskbarHide = NativeMethods.SetTaskbarVisibilityIfIntersect(false, rect);
                    }

                    return(TypeRectangle.Capture(rect));
                }
                finally
                {
                    if (isTaskbarHide)
                    {
                        NativeMethods.SetTaskbarVisibility(true);
                    }
                }
            }

            return(null);
        }
Пример #2
0
        internal static Image Capture(Rectangle bounds)
        {
            TypeRectangle tr = new TypeRectangle();

            return(tr.Capture(bounds, new IntPtr(0), false));
        }
Пример #3
0
        public Image Capture(Rectangle r, IntPtr handle, bool captureCursor)
        {
            Rectangle bounds = CaptureHelpers.GetScreenBounds();

            return(TypeRectangle.Capture(bounds));
        }