| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
IntroductionA recent project at work required that I write out barcode characters and read them. This experience inspired me to start a side project writing some code that renders a barcode on the Windows screen, given the proper input. This is the result of that project. Code 39 basicsThis first article is about drawing Code 39 barcodes on the Windows screen. Before I start discussing the code, we'll need to know some basic facts about the Code 39 barcode symbology. Code 39 was the first alphanumeric symbology developed, and is widely used in industrial settings. Code 39 has two different element widths, wide and narrow, which are usually specified by giving the narrow width and the narrow/wide ratio. Each Code 39 character has five bars and four spaces for a total of nine elements. Of the nine elements, three are wide and six are narrow, leading to the name Code 39 (3 of 9). Each character is followed by an inter-character gap, usually equal to the width of a narrow element. The 44 characters in the Code 39 symbology are listed below:
A Code 39 message begins and ends with an asterisk, which serves as this symbologies start/stop code. A sample Code 39 message “DATA” is pictured below complete with start and stop codes. |