Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, November 22, 2007 4:51:16 AM(UTC)

Ivar  
Ivar

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

 

 
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Saturday, November 24, 2007 10:33:42 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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
File Attachment(s):
vbnetTestBarcode15.zip (15kb) downloaded 22 time(s).
 
#3 Posted : Monday, November 26, 2007 12:20:25 AM(UTC)

Ivar  
Ivar

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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.135 seconds.