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.

Thu Jan 11, 2018 3:48 pm

I don't understand much about barcodes.

I simply need to be able to print out a 5-7 digit (numeric only) barcode.

I want to be able to read it smoothly, with a "standard" handheld Barcode Scanner.

What barcode type should I use that would allow me the "narrowest" barcode that will work?

Also, right now, I am programming in Webforms (vb) and I can get it to work.
But, I also have a possible future need to use this in WPF. Do you guys support WPF?

Thanks

yonahs
 
Posts: 3
Joined: Thu Jan 11, 2018 3:43 pm

Fri Jan 12, 2018 3:41 am

Hello,

Thanks for your inquiry. You could use Code 128 which is flexible. And you could use Spire.Barcode for .Net in WPF application, it can generate and scan the barcode, but the Barcode Control is not available in WPF.

Best regards,
Simon
E-iceblue support team
Last edited by Simon.yang on Tue Jan 16, 2018 1:59 am, edited 1 time in total.
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Fri Jan 12, 2018 5:18 am

Thank you.

SO, I would have to create the image and then display the image?

yonahs
 
Posts: 3
Joined: Thu Jan 11, 2018 3:43 pm

Fri Jan 12, 2018 7:13 am

Hello,

Yes, you could simply create and display the barcode in WPF like below code snippet.
Code: Select all
         Dim settings As New BarcodeSettings()
         settings.Type = BarCodeType.Code128

         Dim data As String = "123456789123456789"
         settings.Data = data
         settings.Data2D = data
         settings.Code128SetMode = Code128SetMode.Auto

         Dim generator As New BarCodeGenerator(settings)
         Dim image = generator.GenerateImage()
          image.Save("result.jpeg", ImageFormat.Jpeg)

          Using loader As New BinaryReader(File.Open("result.jpeg", FileMode.Open))
             Dim fd As New FileInfo("result.jpeg")
             Dim Length As Integer = CInt(fd.Length)
             Dim buf(Length - 1) As Byte
             buf = loader.ReadBytes(CInt(fd.Length))
             loader.Dispose()
             loader.Close()

             'load image and display with Image control
             Dim bim As New BitmapImage()
             bim.BeginInit()
             bim.StreamSource = New MemoryStream(buf)
             bim.EndInit()
             myImage.Source = bim
             GC.Collect()
          End Using


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Mon Jan 15, 2018 11:22 am

Thank you

yonahs
 
Posts: 3
Joined: Thu Jan 11, 2018 3:43 pm

Return to Spire.BarCode