|
|
|||||||
Generating Barcodes in .NET Windows ApplicationDeveloper Guide
Quick Navigate
1. Run Demo Windows Application
2. Install Barcode for .NET dll Component
3. Generate Barcodes in .NET Class
Besides using Windows controller to draw barcodes on your Windows forms, you can also generate barcodes in your .net class directly.
BarcodeLib.Barcode.Linear barcode = new BarcodeLib.Barcode.Linear();
barcode.Type = BarcodeType.CODE39;
barcode.Data = "CODE39";
barcode.UOM = UnitOfMeasure.PIXEL;
barcode.BarWidth = 1;
barcode.BarHeight = 80;
barcode.LeftMargin = 5;
barcode.RightMargin = 5;
barcode.TopMargin = 5;
barcode.BottomMargin = 5;
barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
// save barcode image into your file system
barcode.drawBarcode("C://barcode.png");
// generate barcode & output to byte array
byte[] barcodeInBytes = barcode.drawBarcodeAsBytes();
// generate barcode to Graphics object
Graphics graphics = ...
barcode.drawBarcode(graphics);
// generate barcode and output to Bitmap object
Bitmap barcodeInBitmap = barcode.drawBarcode();
// generate barcode and output to HttpResponse object
HttpResponse response = ...;
barcode.drawBarcode(response);
// generate barcode and output to Stream object
Stream stream = ...;
barcode.drawBarcode(stream);
4. Property Settings for Each Barcode Types
|
||||||||