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();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            // Some biolerplate to react to close window event, CTRL-C, kill, etc
            _handler += new EventHandler(Handler);
            SetConsoleCtrlHandler(_handler, true);
            ocr      = new OneNoteOCRDll.OneNoteOCR();
            findText = new ActionNote();
            // start server
            TcpListener listener = new TcpListener(IPAddress.Any, 1289);

            listener.Start();
            OldStartServer(listener);
        }
Beispiel #3
0
        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);
        }