Esempio n. 1
0
        public static Bitmap CapturePrimaryScreen()
        {
            Rectangle bounds = Screen.PrimaryScreen.Bounds;

            var bitmap = ScreenCapturePInvoke.CaptureScreen(bounds, captureMouse: true);

            return(bitmap);
        }
Esempio n. 2
0
        public static Bitmap CaptureFullScreen()
        {
            var       allBounds = Screen.AllScreens.Select(s => s.Bounds).ToArray();
            Rectangle bounds    = Rectangle.FromLTRB(allBounds.Min(b => b.Left), allBounds.Min(b => b.Top), allBounds.Max(b => b.Right), allBounds.Max(b => b.Bottom));

            var bitmap = ScreenCapturePInvoke.CaptureScreen(bounds, captureMouse: true);

            return(bitmap);
        }