KA.Barcode for .NET WinForms
How to Generate Code 128 Image in .NET WinForms
Source code to generate, print Code 128 in different image formats using Barcode for .NET WinForms
  • Written in C#.NET with full integration into VS.NET develop environments
  • Provide barcode SDK for implementing barcodes as you wish, like ASP.NET ISBN, .NET WinForms Code 39, ASP.NET Code 128, PDF417 ASP.NET, etc.
  • Dynamically generate, create 1D Code 128 in Microsoft .NET framework Windows applications
  • Easy integration into C#.NET, VB.NET projects and applications
  • Print and save Code 128 bar code graphic object locally in Png, Jpeg/Jpg, Gif, Tiff, Bmp file formats
  • Users can adjust resolution through DPI for high-quality image output
  • Compatible with ISO/IEC Code 128 specification for valid Code 128 generation
  • Embedding dynamic linear & 2D barcodes, such as UPC-A Excel, ISBN Excel, .NET PDF417, .NET WinForms Interleaved 2 of 5, in your applications
  • 1D Code 128 image orientation supported in 90, 180, 270 degrees
  • Generating high-quality Code 128 barcode images with thermal printers support
Code 128, also named ANSI/AIM 128, ANSI/AIM Code 128, USS Code 128, Uniform Symbology Specification Code 128, Code 128 Code Set A, Code 128 Code Set B, Code 128 Code Set C, Code 128A, Code 128B, Code 128C, is a self-checking linear bar code which encodes 128 ISO/IEC 646 characters.
Code 128 Barcode Generator Software Component API is a best barcode function of KA.Barcode Generator for .NET Winforms, a high-quality plugin control that allows you to make, integrate Code 128A, Code 128B and Code 128C, as well as other linear, 2-dimensional barcode types in .NET windows applications, C#, Visual Basic .NET class library.
Install Code 128 Barcode Maker into .NET WinForms
  1. 1.
  2. 2.
    Add reference: Add "KeepAutomation.Barcode.Windows.dll" to your .NET Winforms project reference
  3. 3.
    Add to toolbox: To add BarcodeControl to your .NET Winforms toolbox
Code 128 Image Setting with Drag & Drop BarcodeControl
  1. 1.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Windows.dll.
  2. 2.
    In "Choose Toolbox Items" form, click button "Browse...", and select KeepAutomation.Barcode.Windows.dll
  3. 3.
    Drag and drop the BarCodeControl into the Forms and a Codabar image is generated
  4. 4.
    Find barcode setting panel and change barcode symbology into Code 128A, Code 128B or Code 128C.
  5. 5.
    Now you can customize the following setting.

Code 128 Barcode Unit

KeepAutomation provide three units of measures for you to choose, including cm, inch and pixel. Pixel is the default value and the most popular unit of measure. You can change it through Barcode Unit property in the property panel.

Code 128 Image Resolution

KA.Barcode Generator allows you to create and display high quality barcode images in Window Applications. You can adjust Code 39 image resolution through DPI setting for high-quality image generation. Default value is 72 dots per inch.

Code 128 Barcode Margins / Quiet Zones

The ISO/IEC specification for Code 128 requires quiet zones of 10X width on both the left and right side of a Code 128 images, which is automatically calculated and added by KA.Barcode Generator for .NET WInforms. Default value is 0. You can add more margin by adjusting left margin, right margin, top margin and bottom margin.

Code 128 Image Formats

If you want to print and save a Code 28 barcode image, that is easy because KA.Barcode Generator for .NET WinForms allows you to create Code 128 barcodes in Png, Gif, Jpg/Jpeg, Tiff, Bmp to specific image file. You can adjust ImageFormat parameter in the property panel.

Code 128 Image Orientation

To rotate a Code 128 images in different angle, you can find in the property panel the parameter Orientation, and change the default value Degree0 into Degree90, Degree180, or Degree270 to alter Code 128 image position.
Code 128 Image Setting in C#.NET and VB.NET Class Library
Copy the C#/ VB.NET barcode syntax to projects to produce, display a Code 128 barcodes in .NET Windows Forms:
using KeepAutomation.Barcode.Bean;
BarCode code128= new BarCode();
code128. Symbology = Symbology. Code128Auto;
code128.CodeToEncode = "Code128";
code128.BarcodeUnit = BarcodeUnit.Pixel;
code128.DPI = 72;
code128.X =2;
code128.LeftMargin = 3;
code128.RightMargin = 3;
code128.TopMargin = 3;
code128.BottomMargin = 3;
code128.Orientation = KeepAutomation.Barcode.Orientation .Degree90
code128.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
code128.generateBarcodeToImageFile("C:/code128_csharp.png");
Dim code128 As KeepAutomation.Barcode.Bean.BarCode = New KeepAutomation.Barcode.Bean.BarCode

code128.Symbology = KeepAutomation.Barcode.Symbology.Code128Auto
code128.BarcodeUnit = BarcodeUnit.Pixel
code128.DPI = 72
code128.CodeToEncode = " Code128"
code128.X = 3
code128.LeftMargin = 3
code128.RightMargin = 3
code128.TopMargin = 3
code128.BottomMargin = 3
code128.Orientation = KeepAutomation.Barcode.Orientation .Degree90
code128.ImageFormat = System.Drawing.Imaging.ImageFormat.Png
code128.generateBarcodeToImageFile("C://code128 _vb.png")