private async Task OCR(Bitmap bmp) { if (bmp != null && !string.IsNullOrEmpty(Options.Language)) { busy = true; txtResult.Text = ""; UpdateControls(); try { Result = await OCRHelper.OCR(bmp, Options.Language, Options.ScaleFactor, Options.SingleLine); if (Options.AutoCopy && !string.IsNullOrEmpty(Result)) { ClipboardHelpers.CopyText(Result); } } catch (Exception e) { e.ShowError(false); } if (!IsDisposed) { busy = false; txtResult.Text = Result; txtResult.Focus(); txtResult.DeselectAll(); UpdateControls(); } } }
private async Task OCR() { if (bmp != null && !string.IsNullOrEmpty(Options.Language)) { Result = await OCRHelper.OCR(bmp, Options.Language, Options.ScaleFactor); if (Options.AutoCopy && !string.IsNullOrEmpty(Result)) { ClipboardHelpers.CopyText(Result); } if (!IsDisposed) { txtResult.Text = Result; } } }