GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureImaging Class / Barcode1DReaderGetBarcodeValue Method / Barcode1DReaderGetBarcodeValue(Int32,Boolean) Method
Barcode index. Must be between 1 and Barcode1DReaderGetBarcodeCount returned
Flag to retrieve Febraban digital line. If the flag is set, for a Barcode1DReaderInterleaved2of5 barcode, if the info consists in 44 digits, it is convertedm if possible, to a 47 or 48 digits Febraban line value.
Example





In This Topic
Barcode1DReaderGetBarcodeValue(Int32,Boolean) Method
In This Topic
Returns the value of a barcode detected by the Barcode1DReaderDoScan method.
Syntax
'Declaration
 
Public Overloads Function Barcode1DReaderGetBarcodeValue( _
   ByVal BarcodeNo As Integer, _
   ByVal GetFrebrabanDigitalLine As Boolean _
) As String
public string Barcode1DReaderGetBarcodeValue( 
   int BarcodeNo,
   bool GetFrebrabanDigitalLine
)
public function Barcode1DReaderGetBarcodeValue( 
    BarcodeNo: Integer;
    GetFrebrabanDigitalLine: Boolean
): String; 
public function Barcode1DReaderGetBarcodeValue( 
   BarcodeNo : int,
   GetFrebrabanDigitalLine : boolean
) : String;
public: string* Barcode1DReaderGetBarcodeValue( 
   int BarcodeNo,
   bool GetFrebrabanDigitalLine
) 
public:
String^ Barcode1DReaderGetBarcodeValue( 
   int BarcodeNo,
   bool GetFrebrabanDigitalLine
) 

Parameters

BarcodeNo
Barcode index. Must be between 1 and Barcode1DReaderGetBarcodeCount returned
GetFrebrabanDigitalLine
Flag to retrieve Febraban digital line. If the flag is set, for a Barcode1DReaderInterleaved2of5 barcode, if the info consists in 44 digits, it is convertedm if possible, to a 47 or 48 digits Febraban line value.

Return Value

The barcode data.
Remarks

This method is used in the "Barcode Recognition" Demo.

For UCC / EAN-128 codes FNC1 control character is mapped to the <GS> char (ASCII code 29).

Example
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");
 
    // Specify 1D barcode search types to be Code39 and Code128.
    Barcode1DReaderType barcodeType = Barcode1DReaderType.Barcode1DReaderCode39 | Barcode1DReaderType.Barcode1DReaderCode128;
 
    // Start the barcode scanning process. The ExpectedCount parameter is 0, all the barcodes should be retrieved.
    gdpictureImaging.Barcode1DReaderDoScan(imageID, Barcode1DReaderScanMode.BestQuality, barcodeType, false, 0);
 
    using (System.IO.StreamWriter file = new System.IO.StreamWriter("barcodes.txt"))
    {
        int barcodesFound = gdpictureImaging.Barcode1DReaderGetBarcodeCount();
        for (int i = 1; i <= barcodesFound; i++)
        {
            // retrieve Febraban digital line, if detected
            file.WriteLine(gdpictureImaging.Barcode1DReaderGetBarcodeValue(i, true));
        }
    }
 
    // Release used resources.
    gdpictureImaging.Barcode1DReaderClear();
    gdpictureImaging.ReleaseGdPictureImage(imageID);
}
See Also