Bokai Barcode Image Generator .Net Edition, or Barcode .Net for short, is a set of lightweight software components written 100% in managed code (C#) that dynamically generate bar code images in the Microsoft .Net environment. As a bar code image generator, it can be used directly on web servers with ASP.NET; it can also be used to develop native Windows applications (with Windows Forms). For this reason, Barcode .Net supersedes in the .Net environment both BarCode/ASP and BarCode/OCX.
Barcode .Net supports many properties for you to fine tune the bar code image with font of your choice, rotation, color, etc. 25 barcode symbologies or variants are available.
The full documentation is available on-line. A full-featured 28-day trial version is available for download.
In a web environment, the simplest way of using Barcode .Net requires no programming and your HTML pages can be just any plain HTML pages. You embed a barcode image in an HTML page simply by inserting,
<img src="/MyApp/Barcode.aspx?BarcodeType=Code39&Data=123458"> or <img src="BarcodeHandler.aspx?BarcodeType=Code39&Data=123458">
and you'll get this,
The image formats may be GIF (default) or any other .Net supported formats like JPEG, PNG and BMP.Here are more examples:
which would be produced by the following HTML markup:
<img src="/MyApp/Barcode.aspx?BarcodeType=UPCE&Data=1234567&BarWidth=2"> <img src="/MyApp/Barcode.aspx?BarcodeType=UPCA&Data=12345678901&Orientation=LeftFacing"> <img src="/MyApp/Barcode.aspx?BarcodeType=POSTNET&Data=95020-342740&Height=20"> or <img src="BarcodeHandler.aspx?BarcodeType=UPCE&Data=1234567&BarWidth=2"> <img src="BarcodeHandler.aspx?BarcodeType=UPCA&Data=12345678901&Orientation=LeftFacing"> <img src="BarcodeHandler.aspx?BarcodeType=POSTNET&Data=95020-342740&Height=20">
Another way of using Barcode .Net on web servers is to use the BarcodeImage web control, to better take advantage of the design-time features of Visual Studio .Net.
To develop native Windows applications with Windows Forms, you can use either the BarcodeControl or the Barcode component. The Barcode component can be used easily anywhere in your code. BarcodeControl is a control and can be used on Windows Forms; it has a UI that displays the barcode image.
Here's the simplest way of using Barcode or BarcodeControl in your code, which leaves most properties to their default values,
barcode1.BarcodeType = BarcodeType.Code39; barcode1.Data = "12345678"; // unit of measure is 1/100 inch: RectangleF rect = new RectangleF(40.0f, 80.0f, 180.0f, 60.0f); barcode1.Draw(graphics, rect, GraphicsUnit.Inch, 0.01f, 0, null);
where graphics is the Graphics object representing a printer or the screen.You may also generate barcode images in various image formats. For example, the following would generate a barcode image and send it to a stream or a file.
barcode1.MakeImage(ImageFormat.Gif, 1, 40, true, false, null, myOutputStream); barcode1.SaveImage(ImageFormat.Gif, 1, 40, true, false, null, "MyBarcode.gif");
© Copyright 2011 Bokai Corporation