Leadtools.Barcode Namespace > BarcodeReader Class > ReadBarcode Method : ReadBarcode(RasterImage,LeadRect,BarcodeSymbology) Method |
For information about this method please see ReadBarcode(RasterImage,LogicalRectangle,BarcodeSymbology).
public BarcodeData ReadBarcode( RasterImage image, LeadRect searchBounds, BarcodeSymbology symbology )
'Declaration Public Overloads Function ReadBarcode( _ ByVal image As RasterImage, _ ByVal searchBounds As LeadRect, _ ByVal symbology As BarcodeSymbology _ ) As BarcodeData
'Usage Dim instance As BarcodeReader Dim image As RasterImage Dim searchBounds As LeadRect Dim symbology As BarcodeSymbology Dim value As BarcodeData value = instance.ReadBarcode(image, searchBounds, symbology)
public BarcodeData ReadBarcode( RasterImage image, LeadRect searchBounds, BarcodeSymbology symbology )
ObjectiveC Syntax
function Leadtools.Barcode.BarcodeReader.ReadBarcode(RasterImage,LeadRect,BarcodeSymbology)( image , searchBounds , symbology )
public: BarcodeData^ ReadBarcode( RasterImage^ image, LeadRect searchBounds, BarcodeSymbology symbology )
Note: In LEADTOOLS for .NET, the equivalent to Leadtools.LeadRect is Leadtools.Forms.LogicalRectangle.
[TestMethod] public async Task BarcodeReader_ReadBarcodeExample1() { string imageFileName = @"Assets\Barcode2.tif"; // Create a Barcode engine BarcodeEngine engine = new BarcodeEngine(); // Get the Barcode reader instance BarcodeReader reader = engine.Reader; // Load the image using(RasterCodecs codecs = new RasterCodecs()) { StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(imageFileName); using(RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile))) { // Read the QR barcode from this image BarcodeData barcode = reader.ReadBarcode(image, LeadRectHelper.Empty, BarcodeSymbology.QR); // Show its location and data if found if(barcode != null) { Debug.WriteLine("Found at {0}, data:\n{1}", barcode.Bounds, barcode.Value); } else { Debug.WriteLine("Not found"); } } } }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2