Share My Creation Display Code 128 Barcode on Canvas

Latest Version 2.01

The attached project contains an example of a code module that writes a bar code in Code 128 format to a B4J Canvas. V1 is based on some code for B4A that did something similar. It does not require a bar code font as it creates the bar code by drawing the individual lines of the bar code as rectangles. I've updated the code to work with B4J's use of graphics.

The V2 code is loosely based on some VBNet code; I've improved the efficiency though and it now supports characters in ISO/IEC 8859-1 eg £

V2.01 Fixed bug in V2 where signed numbers were not properly encoded.

Derek
 

Attachments

  • ShowBarCode.zip
    5.3 KB · Views: 467
  • £100.PNG
    25.7 KB · Views: 3,155
  • ShowBarCode V2.01.zip
    4.7 KB · Views: 427
Last edited:

Derek Johnson

Active Member
Licensed User
Longtime User
I've updated the original post with a more efficient version, with coverage for a greater symbol range. The bar code encoding creates the shortest bar code in nearly all usage cases. (A curious consequence of this is that numeric bar codes with 2n digits are shorter then bar codes with 2n-1 digits).
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…