示例#1
0
        public IBitmapImage Capture(bool IncludeCursor)
        {
            var cursorPos    = _platformServices.CursorPosition;
            var screenBounds = _platformServices.DesktopRectangle;
            var w            = _settings.AroundMouse.Width;
            var h            = _settings.AroundMouse.Height;

            var region = new Rectangle(cursorPos.X - w / 2, cursorPos.Y - h / 2, w, h);

            if (region.Right > screenBounds.Right)
            {
                region.X = screenBounds.Right - w;
            }

            if (region.Bottom > screenBounds.Bottom)
            {
                region.Y = screenBounds.Bottom - h;
            }

            if (region.X < screenBounds.X)
            {
                region.X = screenBounds.X;
            }

            if (region.Y < screenBounds.Y)
            {
                region.Y = screenBounds.Y;
            }

            return(ScreenShot.Capture(region, IncludeCursor));
        }
示例#2
0
        public override IBitmapImage Capture(bool IncludeCursor)
        {
            if (Source is ScreenItem screenItem)
            {
                return(ScreenShot.Capture(screenItem.Screen.Rectangle, IncludeCursor));
            }

            return(null);
        }
示例#3
0
        public override IBitmapImage Capture(bool IncludeCursor)
        {
            if (Source is WindowItem windowItem)
            {
                return(ScreenShot.Capture(windowItem.Window.Rectangle, IncludeCursor));
            }

            return(null);
        }
 public override IBitmapImage Capture(bool IncludeCursor)
 {
     return(ScreenShot.Capture(IncludeCursor));
 }
示例#5
0
 public override IBitmapImage Capture(bool IncludeCursor)
 {
     return(ScreenShot.Capture(_regionProvider.SelectedRegion, IncludeCursor));
 }