This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Thursday, November 22, 2007 4:51:16 AM(UTC)
Groups: Registered
Posts: 2
Hi
When I run the following example I found in the Leadtools help section, I can not see the actual value of the barcode. The BarcodeData.ConvertToStringArray(data.Data) gives "Barcode Data = System.String[]" in the message box.
Anyone got a clue why?
Kind regrads
Ivar
Dim searchRect As Rectangle = New Rectangle(0, 0, 0, 0)
Dim bar1d As Barcode1d = New Barcode1d()
bar1d.ErrorCheck = True
bar1d.Granularity = 9
bar1d.Direction = BarcodeDirectionFlags.LeftToRight
Dim barRPdf As BarcodeReadPdf = New BarcodeReadPdf()
barRPdf.Direction = BarcodeDirectionFlags.LeftToRight
Dim barColor As BarcodeColor = New BarcodeColor()
barColor.BarColor = Color.Black
barColor.SpaceColor = Color.White
Try
' The Read method will search for all linear barcodes in the whole bitmap
_readBarData = _barEngine.Read(_image, _
searchRect, _
BarcodeSearchTypeFlags.Barcode1dReadAnyType, _
BarcodeUnit.ScanlinesPerPixels, _
BarcodeReadFlags.None, _
0, _
bar1d, _
barRPdf, _
barColor)
Dim count As Integer = _readBarData.Count
Dim i As Integer
For i = 0 To count - 1
Dim data As BarcodeData = _readBarData(i)
Dim barDataMsg As String = String.Format("Barcode Data = {0}" & ControlChars.NewLine & _
"Type = {1}" & ControlChars.NewLine & _
"Left = {2}" & ControlChars.NewLine & _
"Top = {3}" & ControlChars.NewLine & _
"Right = {4}" & ControlChars.NewLine & _
"Bottom = {5}", _
BarcodeData.ConvertToStringArray(data.Data), _
data.SearchType, _
data.Location.Left, _
data.Location.Top, _
data.Location.Right, _
data.Location.Bottom)
MessageBox.Show(
Me, barDataMsg)
MsgBox(BarcodeData.ConvertToStringArray(data.Data))
Next
Catch ex As Exception
MessageBox.Show(
Me, ex.Message)
End Try
#2
Posted
:
Saturday, November 24, 2007 10:33:42 PM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
I am attaching a small VB.Net project that shows how to use the BarcodeEngine.Read method and retrieve the recognized data in BarcodeData class.
If you check the same issue using the attached project, do you face the same problem?
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Monday, November 26, 2007 12:20:25 AM(UTC)
Groups: Registered
Posts: 2
Hi
Thanks.
If I dim'ed a string array, it worked ok:
Dim
barCodeInfo As String()
barCodeInfo = BarcodeData.ConvertToStringArray(data.Data)
MessageBox.Show(
Me, barCodeInfo(0))
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.