Aspose.OCR.Examples.CSharp.FormattingAndManipulatingOCR.SettingtheOcrEngineAutomaticallyDetectTextBlocks.Run C# (CSharp) 메소드

Run() 공개 정적인 메소드

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

            // Create an instance of OcrEngine class
            OcrEngine ocr = new OcrEngine();

            // Set the DetectTextRegions to true
            ocr.Config.DetectTextRegions = true;

            // Set the Image property of OcrEngine by reading an image file
            ocr.Image = ImageStream.FromFile(dataDir + "Sampleocr.bmp");

            // Perform OCR operation on the image
            if (ocr.Process())
            {
                // Display results
                Console.WriteLine(ocr.Text);
            }
            // ExEnd:SettingtheOcrEngineAutomaticallyDetectTextBlocks
        }
    }
SettingtheOcrEngineAutomaticallyDetectTextBlocks