Spire.Barcode is a professional barcode library specially designed for .NET developers (C#, VB.NET, ASP.NET, .NET Core) and Java developers (J2SE and J2EE) to generate, read and scan 1D & 2D barcodes.

Wed Jul 02, 2014 4:08 pm

HI,

I have an application that utilizes a webcam to snap a picture, display it in a PictureBox control, and then scan the image from the control. The code I'm using is:

Code: Select all
Dim datas As String() = Spire.Barcode.BarcodeScanner.Scan(PictureBox1.Image, Spire.Barcode.BarCodeType.Pdf417)


The idea is that it's going to keep snapping and scanning pictures until it successfully scans a PDF417 barcode. However, the very first image that gets scanned (usually before I'm even pointing the camera at the barcode) gets a result which is not Nothing (in vb terms), but a string array of length zero. I'm wondering if the above code is scanning what I think it is, and if the result I'm getting is what I should get if no barcode is found?

nrcarlson
 
Posts: 1
Joined: Wed Jul 02, 2014 3:05 pm

Thu Jul 03, 2014 3:24 am

Hello,

The result you get is right.
Using your code, scanning an image without any Pdf417 barcode will get a string array of length zero.
Therefore scanning an image with two Pdf417 barcodes will get a string array of length two. Scanning result is stored in string array.
If you get any questions, welcome to get it back to us.

Regards,
Benjamin
E-iceblue support team
User avatar

Benjamin Du
 
Posts: 82
Joined: Thu Jul 25, 2013 2:38 am

Return to Spire.BarCode