Platforms to show: All Mac Windows Linux Cross-Platform

/Barcode/generate/Barcode Vector


Required plugins for this example: MBS Barcode Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /Barcode/generate/Barcode Vector

This example is the version from Thu, 18th Dec 2019.

Project "Barcode Vector.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control List Inherits Listbox
ControlInstance List Inherits Listbox
EventHandler Sub ExpandRow(row As Integer) Dim v As Variant = Me.RowTag(row) If v IsA ZintVectorMBS then Dim z As ZintVectorMBS = v Me.AddRow "Width", Str(z.Width) Me.AddRow "Height", Str(z.Height) Dim c() As ZintVectorCircleMBS = z.Circles For Each o As ZintVectorCircleMBS In c AddFolder "Circle", Str(c.IndexOf(o)), o Next Dim r() As ZintVectorRectMBS = z.Rectangles For Each o As ZintVectorRectMBS In r AddFolder "Rectangle", Str(r.IndexOf(o)), o Next Dim h() As ZintVectorHexagonMBS = z.Hexagons For Each o As ZintVectorHexagonMBS In h AddFolder "Hexagon", Str(h.IndexOf(o)), o Next Dim s() As ZintVectorStringMBS = z.Strings For Each o As ZintVectorStringMBS In s AddFolder "String", Str(s.IndexOf(o)), o Next Elseif v IsA ZintVectorCircleMBS Then Dim z As ZintVectorCircleMBS = v Me.AddRow "X", Str(z.X) Me.AddRow "Y", Str(z.Y) Me.AddRow "Diameter", Str(z.Diameter) Me.AddRow "ColorValue", Str(z.ColorValue) Elseif v IsA ZintVectorRectMBS Then Dim z As ZintVectorRectMBS = v Me.AddRow "X", Str(z.X) Me.AddRow "Y", Str(z.Y) Me.AddRow "Width", Str(z.Width) Me.AddRow "Height", Str(z.Height) Me.AddRow "ColorValue", Str(z.ColorValue) Elseif v IsA ZintVectorStringMBS Then Dim z As ZintVectorStringMBS = v Me.AddRow "X", Str(z.X) Me.AddRow "Y", Str(z.Y) Me.AddRow "Width", Str(z.Width) Me.AddRow "Length", Str(z.Length) Me.AddRow "FontSize", Str(z.FontSize) Me.AddRow "Text", z.Text Elseif v IsA ZintVectorHexagonMBS Then Dim z As ZintVectorHexagonMBS = v Me.AddRow "X", Str(z.X) Me.AddRow "Y", Str(z.Y) Me.AddRow "Diameter", Str(z.Diameter) End If End EventHandler
End Control
EventHandler Sub Open() // UPC Version A // UPC-A is used in the United States for retail applications. The // symbol requires an 11 digit article number. The check digit is // calculated by Zint. In addition EAN-2 and EAN-5 add-on symbols can // be added using the + character. test "UPCA", BarcodeGeneratorMBS.BarcodeUpca, "72527270270+12345" test "UPCA", BarcodeGeneratorMBS.BarcodeUpca, "72527270270" // UPC Version E // UPC-E is a zero-compressed version of UPC-A developed for smaller // packages. The code requires a 6 digit article number (digits 0-9). // The check digit is calculated by Zint. EAN-2 and EAN-5 add- on // symbols can be added using the + character as with UPC-A. In // addition Zint also supports Number System 1 encoding by entering a // 7-digit article number stating with the digit 1. test "UPCE", BarcodeGeneratorMBS.BarcodeUpcE, "1123456" // European Article Number (EN 797) 6.1.4.1 EAN-2, EAN-5, EAN-8 and EAN-13 // The EAN system is used in retail across Europe and includes // standards for EAN-2 and EAN-5 add-on codes, EAN-8 and EAN-13 which // encode 2, 5, 7 or 12 digit numbers respectively. Zint will decide // which symbology to use depending on the length of the input data. // In addition EAN-2 and EAN-5 add-on symbols can be added using the + // symbol as with UPC symbols. test "EAN", BarcodeGeneratorMBS.BarcodeEanx, "54321" test "EAN", BarcodeGeneratorMBS.BarcodeEanx, "7432365+54321" // Standard Code 39 was developed in 1974 by Intermec. // Input data can be of any length and supports the characters 0-9, A- // Z, dash (-), full stop (.), space, asterisk (*), dollar ($), slash // (/), plus (+) and percent (%). The standard does not require a // check digit but a modulo-43 check digit can be added if required by // setting Option2 = 1. test "Code39", BarcodeGeneratorMBS.BarcodeCode39, "CODE39" // PDF417 (ISO 15438) // Heavily used in the parcel industry, the PDF417 symbology can // encode a vast amount of data into a small space. Zint supports // encoding up to the ISO standard maximum symbol size of 925 // codewords which (at error correction level 0) allows a maximum data // size of 1850 text characters, or 2710 digits. The width of the // generated PDF417 symbol can be specified at the command line using // the Option2 with a number between 1 and 30, and the amount of check // digit information can be specified by using the Option1 property // with a number between 0 and 8 where the number of codewords used // for check information is determined by 2(value + 1). The default // level of check information is determined by the amount of data // being encoded. International text support is provided using the // Latin-1 character set as described in Appendix A. A separate // symbology ID can be used to encode Health Industry Barcode (HIBC) // data which adds a leading '+' character and a modulo-49 check digit // to the encoded data. test "PDF417", BarcodeGeneratorMBS.BarcodePdf417, "Hello World, Just a test. 123" // 6.6.1 Data Matrix (ISO 16022) Also known as Semacode this symbology // was developed in 1989 by Acuity CiMatrix in partnership with the US // DoD and NASA. The symbol can encode a large amount of data in a // small area. Data Matrix can encode any characters in the Latin-1 // set and can also encode GS1 data. The size of the generated symbol // can also be adjusted using Option2. A separate symbology ID can be // used to encode Health Industry Barcode (HIBC) data which adds a // leading '+' character and a modulo-49 check digit to the encoded // data. Note that only ECC200 encoding is supported, the older // standards have now been removed from Zint. An extra feature is // available for Data Matrix symbols which allows Zint to // automatically resize the symbol as required but also prevents Zint // from using rectangular symbols. To set this mode at the command // line use Option3 = OptionSquare. test "DataMatrix", BarcodeGeneratorMBS.BarcodeDatamatrix, "Hello World" // QR Code // Also known as Quick Response Code this symbology was developed by // Denso. Four levels of error correction are available using the // Option1 property. // Input ECC LevelError Correction Capacity Recovery Capacity // 1 L (default) Approx 20% of symbol Approx 7% // 2 M Approx 37% of symbol Approx 15% // 3 Q Approx 55% of symbol Approx 25% // 4 H Approx 65% of symbol Approx 30% // The size of the symbol can be set by using the Option2 to the QR Code version required (1-40). test "QR Code", BarcodeGeneratorMBS.BarcodeQrcode, "Hello World" // While Zint app is GPL, the ZINT shared library is licensed under BSD 3! End EventHandler
Sub AddFolder(text as string, text2 as string, v as Variant) List.AddFolder Text List.CellTag(List.LastIndex, 1) = text2 List.RowTag(List.LastIndex) = v End Sub
Protected Sub Test(typeLabel as string, type as integer, text as string) Dim z As New BarcodeGeneratorMBS z.Symbology = type z.Encode text AddFolder typeLabel, Text, z.Vector End Sub
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project

See also:

The items on this page are in the following plugins: MBS Barcode Plugin.


The biggest plugin in space...