TesseractOcrEngine Constructor (String, String) |
Namespace: DevScope.Ocr.Tesseract.WindowsPhone
void RunOcrEngine(...) { ... var ocrEngine = new TesseractOcrEngine(tessdataRootFolder.Path, languageCode); // Create the ocr job request var request = new TesseractOcrJobRequest { JobName = "MyJob " + DateTime.Now.ToString() }; // Create the doOcr operation by specifiying a filename that holds the image var operationDoOcr = ocrEngine.DoOcrAsync(request, CommonSettings.FileNameFullResImageSentToOcr); // now, run the ocr and get the results var jobResponse = await operationDoOcr; // handle the results accordingly switch (jobResponse.Status) { case TesseractOcrResultStatus.Error: { MessageBox.Show(_ocrJobResponse.ErrorMessage, "Ocr Error", MessageBoxButton.OK); break; } case TesseractOcrResultStatus.InvalidLicense: { MessageBox.Show("INVALID LICENSE. Please contact Devscope Support.", "Ocr Error", MessageBoxButton.OK); break; } case TesseractOcrResultStatus.Ok: { textOcr.Text = jobResponse.Text; break; } } }