Code 39 Barcode FAQ in C#.NET Barcode Generator DLL

C# class to set Code 39 and Extended Code 39 images and properties in .NET framework with free samples
Barcode in C# > Linear > Code 39 FAQ
Generate Barcode Image Using C#.NET - Code 39 Barcode FAQ in C#
Insert & imbed Code 39 barcode images in C#.NET project with barcode generator DLL is easy and fast, free Code 39 sample code is provided for easy barcode generation and customization. Source code is available with purchase of developer license. Barcode Control SDK for C#.NET is a pure C# written barcode dll to easily integrate into Visual Studio C#.NET project to create high quality barcode as image displayed as Gif, Tiff, Bmp, Png or Jpeg.
This page has a detail introduction of Code 39 barcode settings from the following aspects using C#.NET class method:
  • Generate Code 39 Barcode Images Using C# Class - Code 39 Barcode Data Encoding
  • Generate Code 39 Barcode Images Using C# Class - Code 39 Barcode Special Settings
  • Generate Code 39 Barcode Images Using C# Class - Code 39 Barcode Size Adjustment
  • Generate Code 39 Barcode Images Using C# Class - Code 39 Barcode Image Customization
  • Generate Code 39 Barcode Images Using C# Class - Code 39 Barcode Solution Project Support
Code 39 Barcode in C#.NET Project with Barcode Generator DLL- Code 39 Data Encoding
Code 39 Linear Barcode Valid Data
Code 39 is capable of encoding the following data characters, and Extended Code 39 barcode is able to encode all ASCII characters.
  • Numeric digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • Uppercase letters (A - Z)
  • - (Dash), $ (Dollar), % (Percentage), (Space), . (Point), / (Slash), + (Plus)
  • Lowercase letters (a - z) for Extended Code 39
Code 39 C#.NET Sample Code:
barcode. Symbol = BarcodeSymbol.Code39;
barcode.BarcodeData = "TRCODE39";
Extended Code 39 C#.NET Sample Code:
barcode.Symbol = BarcodeSymbol.Code39_Extension;
barcode.BarcodeData = "Terrek-Code39";
Code 39 Text Option
The human-readable text of Code 39 is flexible to be enabled or disabled in the Code 39 symbols; the default is enabling the Code 39 text. The text styles are easy to be changed from default.
Code 39 C#.NET Sample Code:
barcode.DisplayData = true;
barcode.TextStyle = new Font("Arial", 9f, FontStyle.Regular);
barcode.TextColor = Color.Black;
barcode.TextSpace = 6;
Code 39 Barcode in C#.NET Project with Barcode Generator DLL- Code 39 Special Settings
Code 39 Interspace Gap
Interspace gap means the ratio between the two characters; it is the multiple of X.

Code 39 C#.NET Sample Code: barcode.InterCharGap = 1.0f;
Code 39 Wide to Narrow Ratio
As the name specified, it means the ratio between wide bar and narrow bar, the value ranges from 2.0 to 3.0. The default is 2, developers may change the value through WideVSNarrow property.

Code 39 C#.NET Sample Code: barcode. WideVSNarrow = 2.0f;
Code 39 Start and Stop Character Asterisk "*"
Originally, Code 39 barcode is appended by the start and stop character “*”, but with barcode generator component for C#.NET, the asterisk may be removed.

Code 39 C#.NET Sample Code: DisplayAsterisk = false;
Code 39 Checksum Character
Code 39 is a kind of self-checking barcode symbology, check digit is not necessary to be existed and added to the barcode symbol. But users may also add the checksum character in the symbol to enhance it security.

Code 39 C#.NET Sample Code:
barcode.AutoCheckSum = false;
barcode.ShowCheckSum = true;
Code 39 Barcode in C#.NET Project with Barcode Generator DLL - Code 39 Size Adjustment
Code 39 Bar Size
The X and Y dimension size for Code 39. In barcode generator & control library, they are BarWidth and BarHeight. The whole barcode image is changed according to the adjustment of bar width and bar height.
Code 39 C#.NET Sample Code:
barcode.BarWidth = 1;
barcode.BarHeight =40;
Code 39 Image Size
If the breakdown parameters are unknown, you can set the width and height of the barcode image directly. Once you enabled the image resize function, you only need to provide the size of entire barcode image. This intelligent Code 39 will draw the barcode with reasonable parameters. The generated Code 39 is 100% compatible with ISO / IEC 16388 (2nd edition 2007-05-15).
Code 39 C#.NET Sample Code:
barcode.ImageWidth = 100;
barcode.ImageHeight = 100;
Code 39 Margin Size
Increasing the width of margins around the symbol is one way to enhance the readability of the Code 39 barcode image. The control library set the left, right, top, and bottom margins separately with float values. The default value is 0.
Code 39 C#.NET Sample Code:
barcode. MarginL = 0;
barcode. MarginR = 0;
barcode. MarginT = 0;
barcode. MarginB = 0;
Code 39 Barcode in C#.NET Project with Barcode Generator DLL- Code 39 Image Customization
Code 39 Image Format
Code 39 generated in C#.NET project with barcode control DLL library can be displayed as Gif, Tiff, Bmp, Png, Jpeg and other image formats. Programmers may change the format using BarcodeFormat property.
Code 39 C#.NET Sample Code:
barcode.BarcodeFormat = System.Drawing.Imaging.ImageFormat.Png;
barcode.drawBarcode("C:\\code39.png");
Code 39 Image Resolution
DPI (Dots per inch) is used commonly as the measure of printing resolution. The resolution of image generated by Code 39 generator could be managed with DPI.
Code 39 C#.NET Sample Code:
barcode.DotsPerInch = 96;
Code 39 Image Position
Code 39 position may be influenced by two factors, one is barcode alignment, and the other is rotation. Programmers may set the position by Rotation and BarAlign respectively.
Code 39 C#.NET Sample Code:
barcode.BarAlign = BarAlign.Center;
barcode.Rotation = Rotation.Degree0;
Code 39 Image Color
It is able to change barcode colors with barcode control library DLL using C#.NET class. Both background color and foreground color are easy to be changed by manipulating ImageColor and BarColor respectively.
Code 39 C#.NET Sample Code:
barcode. ImageColor = Color.White;
barcode. BarColor = Color.Black;
Code 39 Barcode in C#.NET Project with Barcode Generator DLL- Code 39 Solution Development
Using C#.NET to create Code 39 barcode images, developers are entitled to create, draw Code 39 barcode images in various development environments. And the following projects can be adopted to fulfill your .NET projects.
  • Windows Forms Application (design-time and runtime support)
  • Console Application (runtime support)
  • Class Library (runtime support)
  • Windows Service (runtime support)
  • ASP.NET Applications (design-time and runtime support)
  • Web Service (runtime support)
  • Crystal Report for .NET (runtime support)
  • Reporting Service Applications (design-time and runtime support)