mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-01 09:47:22 +13:00
Fix crop image in multi monitor
This commit is contained in:
parent
714cadeae2
commit
84d8997cfd
2 changed files with 5 additions and 4 deletions
|
@ -24,7 +24,6 @@ You should have received a copy of the GNU General Public License
|
|||
#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