Link Search Menu Expand Document

Encode Binary Data to QR Code - VB.NET

QR Code SDK sample in VB.NET demonstrating ‘Encode Binary Data to QR Code’

Program.vb
Imports System.Diagnostics
Imports System.Text
Imports Bytescout.BarCode

Class Program

    Friend Shared Sub Main(ByVal args As String())

        ' Create and activate QRCode component instance
        Using barcode As New QRCode()

            barcode.RegistrationName = "demo"
            barcode.RegistrationKey = "demo"
            
            ' Sample byte array to use as value  
            Dim byteArray As Byte() = New Byte() {0, 10, 11, 12, 13, 14, 15, &HFF}

            ' Set value by converting byte array to string  
            barcode.Value = Encoding.ASCII.GetString(byteArray)

            ' Save barcode image
            barcode.SaveImage("result.png")

        End Using

        ' Open the image in default associated application (for the demo purpose)
        Process.Start("result.png")

    End Sub

End Class

Download Source Code (.zip)

Return to the previous page Explore QR Code SDK


Copyright © 2016 - 2021 ByteScout