How to generate barcode image in Visual Basic 6 and Bytescout BarCode SDK and save barcode in EMF (metafile vector image) format - ByteScout

How to generate barcode image in Visual Basic 6 and Bytescout BarCode SDK and save barcode in EMF (metafile vector image) format

  • Home
  • /
  • Articles
  • /
  • How to generate barcode image in Visual Basic 6 and Bytescout BarCode SDK and save barcode in EMF (metafile vector image) format

Screenshot of output barcode (screenshot of EMF image, actual EMF image can be scaled without quality loss):

Code 39 barcode generated with Bytescout BarCode SDK from Visual Basic 6

This example shows how to save barcode in EMF format. EMF format provides vector based way to save the barcode and output image can be scaled (or converted into flash SWF or PDF) without the quality loss

Form1.frm content:

Private Sub Form_Load()
‘ IMPORTANT NOTE: you need to have .NET Framework 1.10 installed to use BarCode SDK from Visual Basic
‘ to download and install .NET Framework 1.10 please use this link: http://www.microsoft.com/downloads/details.aspx?familyid=262D25E3-F589-4842-8157-034D1E7CF3A3

Set bc = CreateObject(“Bytescout.BarCode.Barcode”)

‘ display information about Code39 symbology
MsgBox “Encoding ‘012345’ using Code39 symbology” & vbCrLf & bc.GetValueRestrictions(0) ‘ 0 = Code39 symbology

‘ set symbology type
bc.Symbology = 0 ‘ 0 = Code39

‘ set value to encode
bc.Value = “012345”

MsgBox “Saving Code39 barcode to ‘Code39.emf'”

bc.SaveImage “Code39.emf” ‘ change to “c:Code39.emf” if you can not locate the file. The default directory is the folder where Project1.exe is located

MsgBox “Encoding ‘012345’ using Aztec symbology

‘ set symbology type
bc.Symbology = 17 ‘ 17 = Aztec
‘ set value to encode
bc.Value = “012345”

‘ display information about Aztec symbology
MsgBox “Encoding ‘012345’ using Aztec symbology” & vbCrLf & bc.GetValueRestrictions(17) ‘ 17 = Code39 symbology

bc.SaveImage “Aztec.emf” ‘ change to “c:Aztec.emf” if you can not locate the file. The default directory is the folder where Project1.exe is located

Set bc = Nothing

End Sub

Tutorials:

prev
next