static void Main(string[] args) { var ocr = new OneNoteOCR(); var findText = new ActionNote(); //var pixel = new GetDeviceDpi(); try { ocr.Verify(); } catch (Exception) { Console.WriteLine("you do not have OneNote 15 "); return; } if (args.Length == 0) { Console.WriteLine("please add argument = path to the image file"); return; } //var path = @"C:\Users\gastanica\Desktop\first.png"; var path = @"C:\Users\gastanica\Desktop\second.png"; //var path = @"C:\Users\gastanica\Desktop\screen.jpg"; //var path = @"C:\Users\gastanica\Desktop\2.3.png"; //var path = @"C:\Users\gastanica\Desktop\test2.png"; //var ocrText = ocr.RecognizeImage(args[0]); var ocrText = findText.FindText(path, "ATEUR"); Console.ReadLine(); }
static void Main(string[] args) { var ocr = new OneNoteOCR(); var findText = new ActionNote(); string imagePath = String.Empty; string textToFind = String.Empty; try { ocr.Verify(); } catch (Exception) { Console.WriteLine("you do not have OneNote 15 "); return; } if (Debugger.IsAttached) { imagePath = @"C:\Users\gastanica\Desktop\serverPASS4.png"; textToFind = "daily"; } else { if (args.Length < 2) { Console.WriteLine("please add argument = path to the image file"); return; } imagePath = args[0]; textToFind = args[1]; } TextFound ocrText = new TextFound(0, 0, 0, 0, "", ""); ocrText = findText.FindText(imagePath, textToFind); Console.WriteLine(imagePath); Console.WriteLine(textToFind); Console.WriteLine(ocrText.TextArea); Console.WriteLine(ocrText.Center()); Console.WriteLine(ocrText.ImageText); Console.WriteLine(ocrText.SearchText); }
static void Main(string[] args) { var ocr = new OneNoteOCR(); try { ocr.Verify(); } catch (Exception) { Console.WriteLine("you do not have OneNote 15 "); return; } if (args.Length == 0) { Console.WriteLine("please add argument = path to the image file"); return; } var ocrText = ocr.RecognizeImage(args[0]); Console.WriteLine(ocrText); }