BizCode Barcode Generator for Winforms
The most robust & powerful barcode component for Microsoft .NET Windows Forms
Quick Overviews
  • Professional barcode control
  • Flexible controls provided
  • Support WinForms projects
  • Linear & 2D barcodes support
  • Winforms Data-binding support
How to Generate Code 128 images in .NET WinForms
Code 128 Generator for Winforms is one component of barcode generator for Windows Forms package, which is mature .NET barcode generating and printing class library allowing developers to add Code 128 barcode generating and printing features to .NET Windows Forms applications.
Code 128 Generator for Winforms is easy to draw Code 128 barcode images by using Draw View Barcode Control. Those Code 128 barcode objects can be saved as an image such as TIFF, BMP, GIF, JPEG or PNG files to a specified file name. More Code 128 image related setting please see below; others, like Code 128 size and data setting, please go to:
Code 128 Image Related Properties

Barcode Margin

With Barcode Generator for Winforms, users are allowed to adjust quiet margin of top, bottom, right and left surrounding Code 128 barcode symbols with QuietMargin related property.

Barcode Unit

With Barcode Generator for Winforms, users are allowed to measure Code 128 barcode module size with pixel, cm, or inch using BarcodeUnit .

Barcode Resolution

With Barcode Generator for Winforms, users are allowed to customize the resolution of their Code 128 barcode images in any way they want using Resolution property.

Barcode Rotation

With Barcode Generator for Winforms, users are allowed to set Code 128 barcode images into 0, 90, 180 and 270 degrees using Rotate property.

Image Formats

With Barcode Generator for Winforms, users are allowed to save & output generated Code 128 barcode images into Png, Jpeg/Jpg, Gif, Tiff, Bmp, etc using ImageFormat property.

.NET Winforms Graphic Objects

With Barcode Generator for Winforms, users are allowed to save generated Code 128 barcode images into .NET Graphics, Stream and Bitmap objectsin accordance with users' needs.
Customize Code 128 Barcode Images in Winforms
Ensure have installed those programs before you customize Code 128 image in .NET Winforms:
Customize Code128 Barcode Images in Windows Forms Using BarcodeControl
  1. Add .NET Winforms Barcode Control onto your .NET Visual Studio Toolbox;
  2. Drag and drop the WinLinearBarcode control into the Forms;
  3. You will see a barcode image generated;
  4. Right click you mouse to activate barcode setting panel and choose Symbology to CODE128
  5. Select Resolution, Rotate, BarcodeUnit, TopMargin, BottomMargin, RightMargin, LeftMargin, ImageFormat respectively to customize your Code 128 barcodes.
Customize Code Barcode Images in Winforms Using C#, VB.NET Class
using BusinessRefinery.Barcode;

Linear barcode = new Linear();
barcode.Symbology = Symbology.CODE128;
barcode.Code = "0123456789";

// Measure Code 128 barcode module size with pixel, cm, or inch
barcode.BarcodeUnit = BarcodeUnit.PIXEL;

// Adjust Code 128 barcode margin of top, bottom, left and right
barcode.BottomMargin = 7;
barcode.TopMargin = 7;
barcode.LeftMargin = 5;
barcode.RightMargin = 5;

// Change Code 128 resolution in DPI
barcode.Resolution = 104;

// Rotate Code 128 barcode image
barcode.Rotate = Rotate.Rotate180;

// Save Code 128 in multiple image formats
barcode.Format = ImageFormat.Gif;
barcode.drawBarcode2ImageFile("c:/code-128-csharp.gif");

// Save Code 128 barcode in Winforms objects
public void drawBarcode2ImageFile(string filename);
public void drawBarcode2Stream(Stream fileStream);
public byte[] drawBarcodeAsBytes();
public Bitmap drawBarcodeOnBitmap();
public void drawBarcodeOnGraphics(Graphics graphics);
Dim barcode As BusinessRefinery.Barcode.Linear = 
New BusinessRefinery.Barcode.Linear()

barcode.Symbology = BusinessRefinery.Barcode.Symbology.CODE128
barcode.Code = "0123456789"

' Measure Code 128 barcode module size with pixel, cm, or inch
barcode.BarcodeUnit = BarcodeUnit.PIXEL

' Adjust Code 128 barcode margin of top, bottom, left and right
barcode.BottomMargin = 7
barcode.TopMargin = 7
barcode.LeftMargin = 5
barcode.RightMargin = 5

' Change Code 128 resolution in DPI
barcode.Resolution = 104

' Rotate Code 128 barcode image
barcode.Rotate = Rotate.Rotate180

' Save Code 128 in multiple image formats
barcode.Format = ImageFormat.Gif
barcode.drawBarcode2ImageFile("c:/code-128-vb-net.gif")

' Save Code 128 barcode in Winforms objects
Public Sub drawBarcode2Stream(ByVal fileStream As System.IO.Stream)
Public Sub drawBarcodeOnGraphics(ByVal graphics As
System.Drawing.Graphics)
Public Function drawBarcodeAsBytes() As Byte()
Public Function drawBarcodeOnBitmap() As System.Drawing.Bitmap