Aspose.OCR.Examples.CSharp.PerformingandManagingOCR.PerformOCROnImage.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:PerformOCROnImage   
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_OMR();

            // Initialize an instance of OcrEngine
            OcrEngine ocrEngine = new OcrEngine();

            // Set the Image property by loading the image from file path location or an instance of MemoryStream 
            ocrEngine.Image = ImageStream.FromFile(dataDir + "Sampleocr.bmp");

            // Process the image
            if (ocrEngine.Process())
            {
                // Display the recognized text
                Console.WriteLine(ocrEngine.Text);
            }
            // ExEnd:PerformOCROnImage   
        }
    }
PerformOCROnImage