mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-30 20:20:34 +12:00
Fix crop image in multi monitor
This commit is contained in:
parent
714cadeae2
commit
84d8997cfd
|
@ -24,7 +24,6 @@
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using System.Drawing;
|
||||
using ShareX.HelpersLib;
|
||||
|
||||
namespace ShareX.ScreenCaptureLib
|
||||
{
|
||||
|
|
|
@ -1248,11 +1248,13 @@ public void CropArea(Rectangle rect)
|
|||
|
||||
public Image CropImage(Rectangle rect, bool onlyIfSizeDifferent = false)
|
||||
{
|
||||
rect.X -= form.ImageRectangle.X;
|
||||
rect.Y -= form.ImageRectangle.Y;
|
||||
|
||||
rect = CaptureHelpers.ScreenToClient(rect);
|
||||
|
||||
Point offset = CaptureHelpers.ScreenToClient(form.ImageRectangle.Location);
|
||||
|
||||
rect.X -= offset.X;
|
||||
rect.Y -= offset.Y;
|
||||
|
||||
rect.Intersect(new Rectangle(0, 0, form.Image.Width, form.Image.Height));
|
||||
|
||||
if (rect.IsValid() && (!onlyIfSizeDifferent || rect.Size != form.Image.Size))
|
||||
|
|
Loading…
Reference in a new issue