mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 10:47:02 -07:00
Experimenting with some OCR and QR use cases.
This commit is contained in:
parent
3c7a93a8a7
commit
5c6a3f2f78
7 changed files with 346 additions and 74 deletions
|
@ -21,10 +21,8 @@
|
|||
|
||||
using System.Threading.Tasks;
|
||||
using GreenshotPlugin.Core;
|
||||
using GreenshotPlugin.IniFile;
|
||||
using GreenshotPlugin.Interfaces;
|
||||
using GreenshotPlugin.Interfaces.Ocr;
|
||||
using log4net;
|
||||
|
||||
namespace GreenshotWin10Plugin.Processors {
|
||||
/// <summary>
|
||||
|
@ -37,12 +35,18 @@ namespace GreenshotWin10Plugin.Processors {
|
|||
|
||||
public override bool ProcessCapture(ISurface surface, ICaptureDetails captureDetails)
|
||||
{
|
||||
if (captureDetails.OcrInformation != null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
var ocrProvider = SimpleServiceProvider.Current.GetInstance<IOcrProvider>();
|
||||
|
||||
var ocrResult = Task.Run(async () => await ocrProvider.DoOcrAsync(surface)).Result;
|
||||
|
||||
if (!ocrResult.HasContent) return false;
|
||||
|
||||
captureDetails.OcrInformation = ocrResult;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue