Private void rBStop_CheckedChanged(object sender, EventArgs e) a checkbox on the form to toggle to processign in the background Var hWnd = Processing.WinGetHandle(Title.ToLower()) Readonly ConcurrentBag _list = new ConcurrentBag() Ĭonst string Title = "myFavoriteGameTitel" // title of window to process These are the main routines – the rest just stitches them together and makes sure the processing is done in the background: Using (var engine = new TesseractEngine(Path.Combine(, "tessdata") for testing if you want to ImageFormat.Png) Var b = new Bitmap(sc.CaptureWindow(hWnd)) Public static void ExtractTextFromImage(IntPtr hWnd, ConcurrentBag list) For rightfully initiationg it, you need to have the tessdata folder deployed and filled with your language files Then we can capture the image and let ir be processed by the Tesseract engine. Throw new ApplicationException("More than one application was found") Throw new ApplicationException("No application was found") Var titles = Process.GetProcesses().Where(pList => ().Contains(wName)).ToList() Public static IntPtr WinGetHandle(string wName) The main routine to call for the OCR needs to:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |