From 3f10f9ec492549193092a93a54f44ce0d11bb76f Mon Sep 17 00:00:00 2001 From: Jaex Date: Thu, 21 Mar 2019 00:08:08 +0300 Subject: [PATCH] fixed #2192: Instead of all screen bounds, instead use intersected screen bounds when cropping outside area --- ShareX.ScreenCaptureLib/Screenshot_Transparent.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ShareX.ScreenCaptureLib/Screenshot_Transparent.cs b/ShareX.ScreenCaptureLib/Screenshot_Transparent.cs index e05c7a271..e59864897 100644 --- a/ShareX.ScreenCaptureLib/Screenshot_Transparent.cs +++ b/ShareX.ScreenCaptureLib/Screenshot_Transparent.cs @@ -27,6 +27,7 @@ using System; using System.Drawing; using System.Drawing.Imaging; +using System.Linq; using System.Threading; using System.Windows.Forms; @@ -43,7 +44,8 @@ public Image CaptureWindowTransparent(IntPtr handle) if (CaptureShadow && !NativeMethods.IsZoomed(handle) && NativeMethods.IsDWMEnabled()) { rect.Inflate(ShadowOffset, ShadowOffset); - rect.Intersect(CaptureHelpers.GetScreenBounds()); + Rectangle intersectBounds = Screen.AllScreens.Select(x => x.Bounds).Where(x => x.IntersectsWith(rect)).Combine(); + rect.Intersect(intersectBounds); } Bitmap whiteBackground = null, blackBackground = null, whiteBackground2 = null;