mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-29 17:02:05 +13:00
Also recognize in monitor and window capture
This commit is contained in:
parent
c2036f2bed
commit
7be77c4ee0
2 changed files with 11 additions and 6 deletions
|
@ -38,8 +38,9 @@ public CaptureMonitor(Rectangle monitorRectangle)
|
|||
|
||||
protected override ImageInfo Execute(TaskSettings taskSettings)
|
||||
{
|
||||
Image img = TaskHelpers.GetScreenshot().CaptureRectangle(MonitorRectangle);
|
||||
return new ImageInfo(img);
|
||||
ImageInfo imageInfo = CreateImageInfo(MonitorRectangle);
|
||||
imageInfo.Image = TaskHelpers.GetScreenshot().CaptureRectangle(MonitorRectangle);
|
||||
return imageInfo;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,6 +24,7 @@ You should have received a copy of the GNU General Public License
|
|||
#endregion License Information (GPL v3)
|
||||
|
||||
using ShareX.HelpersLib;
|
||||
using ShareX.ScreenCaptureLib;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
|
@ -51,18 +52,21 @@ protected override ImageInfo Execute(TaskSettings taskSettings)
|
|||
NativeMethods.SetForegroundWindow(WindowHandle);
|
||||
Thread.Sleep(250);
|
||||
|
||||
Image img;
|
||||
ImageInfo imageInfo = new ImageInfo();
|
||||
WindowInfo windowInfo = new WindowInfo(WindowHandle);
|
||||
imageInfo.WindowTitle = windowInfo.Text;
|
||||
imageInfo.ProcessName = windowInfo.ProcessName;
|
||||
|
||||
if (taskSettings.CaptureSettings.CaptureTransparent && !taskSettings.CaptureSettings.CaptureClientArea)
|
||||
{
|
||||
img = TaskHelpers.GetScreenshot(taskSettings).CaptureWindowTransparent(WindowHandle);
|
||||
imageInfo.Image = TaskHelpers.GetScreenshot(taskSettings).CaptureWindowTransparent(WindowHandle);
|
||||
}
|
||||
else
|
||||
{
|
||||
img = TaskHelpers.GetScreenshot(taskSettings).CaptureWindow(WindowHandle);
|
||||
imageInfo.Image = TaskHelpers.GetScreenshot(taskSettings).CaptureWindow(WindowHandle);
|
||||
}
|
||||
|
||||
return new ImageInfo(img);
|
||||
return imageInfo;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue