Read Barcodes Asynchronously
We can read barcodes using the BarcodeReader
class. The easiest method to use is the BarcodeReader.Read
method. IronBarcode also has a ReadAsync
method for multithreaded asynchronous programming.
Key Points
Synchronous vs Asynchronous Methods
Read
method is straightforward for use when immediate results are needed and is called on the main thread.ReadAsync
method is for asynchronous execution, allowing the program to continue with other tasks while waiting for the barcode reading to complete.
BarcodeReaderOptions
ExpectMultipleBarcodes
: If set totrue
, the reader will look for multiple barcodes in the image.EnhanceAccuracy
: Improves accuracy at the cost of speed.SpeedUp
: Increases reading efficiency, which might be useful for processing large numbers of images quickly. However, this might reduce accuracy if set totrue
.
Unlock the Power of Multithreading with Our Async Barcode Reading Guide!