mirror of https://github.com/ShareX/ShareX.git
Compare commits
4 Commits
f06e1b79c6
...
9397870e2b
Author | SHA1 | Date |
---|---|---|
Danny | 9397870e2b | |
Jaex | 47bc35bf99 | |
Danny | 08abafe83a | |
Danny | d860104a08 |
|
@ -137,6 +137,7 @@ namespace ShareX
|
|||
else
|
||||
{
|
||||
RegionCaptureTasks.GetRectangleRegion(out captureRectangle, out WindowInfo windowInfo, taskSettings.CaptureSettings.SurfaceOptions);
|
||||
|
||||
metadata.UpdateInfo(windowInfo);
|
||||
}
|
||||
break;
|
||||
|
@ -149,6 +150,10 @@ namespace ShareX
|
|||
{
|
||||
captureRectangle = CaptureHelpers.GetActiveWindowRectangle();
|
||||
}
|
||||
|
||||
IntPtr handle = NativeMethods.GetForegroundWindow();
|
||||
WindowInfo activeWindowInfo = new WindowInfo(handle);
|
||||
metadata.UpdateInfo(activeWindowInfo);
|
||||
break;
|
||||
case ScreenRecordStartMethod.CustomRegion:
|
||||
captureRectangle = taskSettings.CaptureSettings.CaptureCustomRegion;
|
||||
|
|
|
@ -1312,10 +1312,11 @@ namespace ShareX
|
|||
{
|
||||
if (taskSettings == null) taskSettings = TaskSettings.GetDefaultTaskSettings();
|
||||
|
||||
await OCRImage(bmp, taskSettings.CaptureSettingsReference.OCROptions, filePath);
|
||||
bool notificationsEnabled = taskSettings.GeneralSettings.ShowToastNotificationAfterTaskCompleted;
|
||||
await OCRImage(bmp, taskSettings.CaptureSettingsReference.OCROptions, filePath, notificationsEnabled);
|
||||
}
|
||||
|
||||
private static async Task OCRImage(Bitmap bmp, OCROptions options, string filePath = null)
|
||||
private static async Task OCRImage(Bitmap bmp, OCROptions options, string filePath = null, bool notificationsEnabled = true)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -1325,7 +1326,7 @@ namespace ShareX
|
|||
{
|
||||
if (options.Silent)
|
||||
{
|
||||
await AsyncOCRImage(bmp, options, filePath);
|
||||
await AsyncOCRImage(bmp, options, filePath, notificationsEnabled);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1348,9 +1349,9 @@ namespace ShareX
|
|||
}
|
||||
}
|
||||
|
||||
private static async Task AsyncOCRImage(Bitmap bmp, OCROptions options, string filePath = null)
|
||||
private static async Task AsyncOCRImage(Bitmap bmp, OCROptions options, string filePath = null, bool notificationsEnabled = true)
|
||||
{
|
||||
ShowNotificationTip(Resources.OCRForm_AutoProcessing);
|
||||
if (notificationsEnabled) ShowNotificationTip(Resources.OCRForm_AutoProcessing);
|
||||
|
||||
string result = null;
|
||||
|
||||
|
@ -1372,11 +1373,11 @@ namespace ShareX
|
|||
File.WriteAllText(textFilePath, result, Encoding.UTF8);
|
||||
}
|
||||
|
||||
ShowNotificationTip(Resources.OCRForm_AutoComplete);
|
||||
if (notificationsEnabled) ShowNotificationTip(Resources.OCRForm_AutoComplete);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotificationTip(Resources.OCRForm_AutoCompleteFail);
|
||||
if (notificationsEnabled) ShowNotificationTip(Resources.OCRForm_AutoCompleteFail);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2182,4 +2183,4 @@ namespace ShareX
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue