Also recognize in monitor and window capture

This commit is contained in:
Jaex 2017-03-01 13:28:00 +03:00
parent c2036f2bed
commit 7be77c4ee0
2 changed files with 11 additions and 6 deletions

View file

@ -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;
}
}
}

View file

@ -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;
}
}
}