Barcode Visual C#.NET Integration Guide

How to control barcode generators using Visual C# .NET

Barcode for C#
.NET Imaging Component
Home > Barcode in C#
This guide walks you through the general setup process of barcode generators in Visual C# .NET and the main features of the barcode generators. Barcode generators that support developing in C#.NET include .NET Barcode Winforms Generator, ASP.NET Barcode Generator, and Barcode Font Generator. This guide includes:
Barcode Generation in C#.NET

C#.NET Barcode Generator Control Setup Process

General Code Sample in C#.NET

BarCode barcodeincsharp = new BarCode();
// e.g.Code128, selelet other barcode by changing Code128 to other
barcodeincsharp.Symbology = Symbology.Code128;
// Input Data
barcodeincsharp.CodeToEncode = "Insert Data in Barcode Here";
// Define Image format
barcodeincsharp.ImageFormat = ImageFormat.Png;
//Define location and file name of the barcode image
barcodeincsharp.generateBarcodeToImageFile("D://barcodeimage.png");

Barcode General Size Setting

//Unit Setting; support pixel, cm, and inch
barcodeincsharp.BarcodeUnit = BarcodeUnit.Pixel;
//Size module bar width; float value; defaul 2
barcodeincsharp.X = 1;
//Size module bar height; float value; defaul 75
barcodeincsharp.Y = 50;
//Size barcode image width; float value; defaul 0
barcodeincsharp.BarCodeWidth = 175;
//Size barcode image height; float value; defaul 0
barcodeincsharp.BarCodeHeight = 60;
//Size Top Margin of the barcode; float value; defaul 0
barcodeincsharp.TopMargin = 10;
//Size Bottom Margin of the barcode; float value; defaul 0
barcodeincsharp.BottomMargin = 10;
//Size Left Margin of the barcode; float value; defaul 0
barcodeincsharp.LeftMargin = 10;
//Size Right Margin of the barcode; float value; defaul 0
barcodeincsharp.RightMargin = 10;

Barcode General Image Property Setting

//Set image resolution of the barcode; int value; defaul 96
barcodeincsharp.DPI = 96;
//Set Orientation of symbol in the image; options include 0,90,180,270 degrees
barcodeincsharp.Orientation = Orientation.Degree90;
//Set image format;options include Gif,Png,Tiff,Jpeg,Bmp
barcodeincsharp.ImageFormat = ImageFormat.Png;

Barcode General Data Encodation Setting

//Input Data in the barcode, pay attention to the character set of the barcode you are printing 
barcodeincsharp.CodeToEncode = "Insert Data in Barcode Here";