Aspose.BarCode.Examples.CSharp.ManageAndOptimizeBarCodeRecognition.ReadBarcodeSpecificRegionOfImage.Run C# (CSharp) 메소드

Run() 공개 정적인 메소드

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

                // Create an instance of BarCodeReader class and specify an area to look for the barcode
                BarCodeReader reader = new BarCodeReader(new Bitmap(dataDir + "ReadBarcodefromSpecificRegionofImage.png"), new Rectangle(0, 0, 100, 50), DecodeType.Pdf417);

                // Read all barcodes in the provided area
                while (reader.Read() == true)
                {
                    // Display the codetext and symbology type of the barcode found
                    Console.WriteLine("Codetext: " + reader.GetCodeText() + " Symbology: " + reader.GetCodeType());
                }

                // Close the reader
                reader.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message + "\nThis example will only work if you apply a valid Aspose BarCode License. You can purchase full license or get 30 day temporary license from http://wwww.aspose.com/purchase/default.aspx.");
            }
        }
    }
ReadBarcodeSpecificRegionOfImage