BizCode Generator for .NET Ultimate
The most robust & powerful barcode generating SDK for Microsoft .NET Framework
Quick Overviews
  • Mature barcode creating SDK
  • Support .NET 2.0/3.0/4.0
  • 100% developed in C#.NET
  • Dynamic barcodes support
  • User-defined controls provided
How to Generate Code 39 images in C#
Code 39 Generator for Visual C#.NET is one function of BizCode Generator for .NET Ultimate. It can be completely run in C#.NET and easily integrated into any C#.NET applications. Comprehensive C#.NET sample code is provided as a developer guide for users to generating Code 39, Code 39 Extension barcodes in their C#.NET project.
This page explains how to manipulate Code 39 and Code 39 extension barcode image with detailed C# sample code. If you want to know more sample codings about size and data customization of Code 39 and Code 39 Extension barcode, please see:
Code 39 Image Related Properties

Start & Stop Characters

Users may simple add an "*" for Code 39 and Code 39 Extension barcodes that is a starting and stopping symbol for data sequence of Code 39 and Code 39 Extension barcode with DisplayStartStopChar property provided by BizCode Generator for .NET Ultimate.

Barcode Resolution

Users may easily change barcode resolution in DPI that can be used for both high-resolution output and low-resolution output printers with Resolution property provided by BizCode Generator for .NET Ultimate.

Barcode Rotation

Users may easily change barcode rotation angle into 0, 90, 180 and 270 degrees that can be recognized by all scanners with Rotate property provided by BizCode Generator for .NET Ultimate.

Image Formats

Users may easily save barcode images into various image formats for different purpose, like Png, Jpeg/Jpg, Gif, Tiff, Bmp, with ImageFormat property provided by BizCode Generator for .NET Ultimate.

C#.NET Graphic Objects

Users may easily save barcode images into .NET graphic objects, Graphics, Stream and Bitmap objects, with DrawBarcode property provided by BizCode Generator for .NET Ultimate.
Customize Code 39 Barcode Images in C#.NET
If you want to customize Code 39 image in C#.NET, be sure that you have installed:
Customize Code 39 Barcode Images in .NET Project Using C# Class
Copy those following code onto your C#.NET projects:
using BusinessRefinery.Barcode;

Linear barcode = new Linear();
barcode.Symbology = Symbology.CODE39;
barcode.Code = "0123456789";
barcode.drawBarcode2ImageFile("c:/code-39-csharp.gif");
Show Start & Stop Character for Code 39 Barcode
DisplayStartStopChar default value in BizCode Generator for .NET Ultimate is false.

Copy those following code to add start and stop characters:
barcode.DisplayStartStopChar = true;
Change Code 39 Resolution in DPI
Resolution default value in BizCode Generator for .NET Ultimate is 72 dpi.

Copy those following code to change your resolution:
barcode.Resolution = 104;
Adjust Code 39 Barcode Quiet Margin
BottomMargin, TopMargin , LeftMargin and RightMargin default value in BizCode Generator for .NET Ultimate is 0 respectively.

Copy those following code to change your quiet margin size:
barcode.BottomMargin = 7;
barcode.TopMargin = 7;
barcode.LeftMargin = 5;
barcode.RightMargin = 5;
Change Code 39 Image Rotation
Resolution default value in BizCode Generator for .NET Ultimate is Rotate.Rotate0.

Copy those following code to change your image rotation angle:
barcode.Rotate = Rotate.Rotate180;
Show Code 39 Barcode Human-Readable Text
DisplayText default value in BizCode Generator for .NET Ultimate is true.

TextFont default value in BizCode Generator for .NET Ultimate is new Font("Arial", Font.PLAIN, 11).

TextMargin default value in BizCode Generator for .NET Ultimate is 6 pixel.

Copy those following code to change your human-readable text:
barcode.DisplayText = true;
barcode.TextFont = new Font("Arial", 11.0f, FontStyle.Bold);
barcode.TextMargin = 10;
Save Code 39 in Multiple Image Formats
Format default value in BizCode Generator for .NET Ultimate is gif.

Copy those following code to change your image format:
barcode.Format = ImageFormat.Png;
barcode.drawBarcode2ImageFile("c:/ean-128-csharp.Png");
Users may change image format into gif, png, tiff, jpeg, png; or save it as C#.NET graphic objects:
public void drawBarcode2ImageFile(string filename);
public void drawBarcode2Stream(Stream fileStream);
public byte[] drawBarcodeAsBytes();
public Bitmap drawBarcodeOnBitmap();
public void drawBarcodeOnGraphics(Graphics graphics);