Accusoft.BarcodeXpress12.Net - Updated
BarcodeDataAsByte Property
Example 




Accusoft.BarcodeXpressSdk Namespace > Result Class : BarcodeDataAsByte Property
Gets the recognized barcode data value in bytes.
Syntax
'Declaration
 
Public ReadOnly Property BarcodeDataAsByte As Byte()
'Usage
 
Dim instance As Result
Dim value() As Byte
 
value = instance.BarcodeDataAsByte
public byte[] BarcodeDataAsByte {get;}
public: __property byte[]* get_BarcodeDataAsByte();
public:
property array<byte>^ BarcodeDataAsByte {
   array<byte>^ get();
}

Property Value

The byte value.
Remarks

This property returns the byte value only. It is merely binary data. Barcode Xpress does not not know what type of encoding is supposed to be used for the data. Determining the correct encoding is the responsibility of the application, not Barcode Xpress.

See the Result Class for more information about retrieving results.

Example
using Accusoft.BarcodeXpressSdk;
             
// call Analyze to detect barcodes in the image
// all detected barcodes will be returned to the
// Result object array.
Result[] results = bcXpress.reader.Analyze(hDib);
            
// get some results info, if any
for (int i = 0; i < results.Length; i++)
{
   // get result for current barcode
   Result curResult = (Result)results.GetValue(i);
            
   // UTF8 encoded data
   MessageBox.Show("Value=" + Encoding.UTF8.GetString(curResult.BarcodeDataAsByte) + "\r");
   
   // Japanese data
   System.Text.Encoding encJapanese = System.Text.Encoding.GetEncoding(932); // Code page for Japanese (Shift-JIS)
   MessageBox.Show("Value=" + System.Text.UnicodeEncoding.Unicode.GetString(System.Text.Encoding.Convert(encJapanese, System.Text.UnicodeEncoding.Unicode, curResult.BarcodeDataAsByte)));
}
See Also

Reference

Result Class
Result Members