PASO 1:
Creamos una venta como esta. Textbox, Boton, Label y PictureManager
PASO 2:
Argegamos el API ()
Imports System.Drawing.Text
Imports ThoughtWorks.QRCode
Imports ThoughtWorks.QRCode.Codec
Imports ThoughtWorks.QRCode.Codec.Data
PASO 3:
Creamos los siguiente metodos.
Dim fuente As Font
Public Sub cargarfuente()
Dim pfc As PrivateFontCollection = New PrivateFontCollection()
Dim fontFamily As FontFamily
'se obteniene la ruta del API, para cargarlo
pfc.AddFontFile(My.Application.Info.DirectoryPath & "\code128.TTF")
fontFamily = pfc.Families(0)
fuente = New Font(fontFamily, 50)
End Sub
Private Sub Codificar(ByVal texto As String)
Dim qrCodeEncoder As QRCodeEncoder = New QRCodeEncoder
qrCodeEncoder.QRCodeEncodeMode = Codec.QRCodeEncoder.ENCODE_MODE.BYTE
qrCodeEncoder.QRCodeVersion = 0
Try
PictureBox1.Image = qrCodeEncoder.Encode(texto)
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
PASO 4.
En el metodo del boton ponemos.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
cargarfuente()
lblCodigo.Font = fuente
lblCodigo.Text = txtCodigo.Text
lblTexto.Text = txtCodigo.Text.Trim().ToString()
Codificar(txtCodigo.Text)
End Sub
ConversionConversion EmoticonEmoticon