Barcode1DReaderDoScan(Int32,Barcode1DReaderScanMode) Method
Starts a barcode recognition process on a specified GdPicture image or on an area of a specified GdPicture image defined by the
GdPictureImaging.SetROI method. This method allows you to set the scanning mode parameter according to your preference.
Parameters
- ImageID
- A unique image identifier of the GdPicture image representing the image in use.
- ScanMode
- A member of the Barcode1DReaderScanMode enumeration. The scan mode (speed or quality) used for scanning process.
Return Value
A member of the GdPictureStatus enumeration. If the method has been successfully followed, then the return value is GdPictureStatus.OK.
We strongly recommend always checking this status first.
Finding all 1D barcodes in a given image and saving their information to a file.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", false);
// Start the barcode scanning process to find all available 1D barcode symbols using the best speed.
gdpictureImaging.Barcode1DReaderDoScan(imageID, Barcode1DReaderScanMode.BestSpeed);
using (System.IO.StreamWriter file = new System.IO.StreamWriter("barcodes.txt"))
{
int barcodesFound = gdpictureImaging.Barcode1DReaderGetBarcodeCount();
for (int i = 1; i <= barcodesFound; i++)
{
file.WriteLine(gdpictureImaging.Barcode1DReaderGetBarcodeValue(i));
}
}
// Release used resources.
gdpictureImaging.Barcode1DReaderClear();
gdpictureImaging.ReleaseGdPictureImage(imageID);
}