mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
Made the Win10 share work, at least somewhat.
This commit is contained in:
parent
4da8f223da
commit
5779d2ac2b
7 changed files with 365 additions and 4 deletions
|
@ -39,6 +39,9 @@ namespace GreenshotWin10Plugin
|
|||
public override string Designation { get; } = "OCR";
|
||||
public override string Description { get; } = "Windows 10 OCR";
|
||||
|
||||
/// <summary>
|
||||
/// Constructor, this is only debug information
|
||||
/// </summary>
|
||||
public Win10OcrDestination()
|
||||
{
|
||||
var languages = OcrEngine.AvailableRecognizerLanguages;
|
||||
|
@ -58,7 +61,7 @@ namespace GreenshotWin10Plugin
|
|||
/// <returns>ExportInformation</returns>
|
||||
public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails)
|
||||
{
|
||||
ExportInformation exportInformation = new ExportInformation(Designation, Description);
|
||||
var exportInformation = new ExportInformation(Designation, Description);
|
||||
try
|
||||
{
|
||||
var text = Task.Run(async () =>
|
||||
|
@ -76,7 +79,13 @@ namespace GreenshotWin10Plugin
|
|||
return ocrResult.Text;
|
||||
}
|
||||
}).Result;
|
||||
ClipboardHelper.SetClipboardData(text);
|
||||
|
||||
// Check if we found text
|
||||
if (!string.IsNullOrWhiteSpace(text))
|
||||
{
|
||||
// Place the OCR text on the
|
||||
ClipboardHelper.SetClipboardData(text);
|
||||
}
|
||||
exportInformation.ExportMade = true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue