$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Barcode OutputTypes in ASP.NET AJAX
Home > How to > Barcode Output Type

Ketiic Barcode UI ASP.NET AJAX offers users the comprehensive and easy to use barcode creating, barcode customizing as well as barcode image outputting ad saving tools. The barcode creating and defining objects have been discussed in C# barcode type tutorial (particular barcode getting started guides and detailed sample codes), then, in this page, we will talk about how to set barcode output types within ASP.NET barcode creating application.
Technically speaking, the output types of Kettic PerBarcode control can be specified into two versions: SVG_VML and EmbeddedPNG. The former is a vector image format while the latter is a raster image file. In the first case, created barcode image is rendered and saved as SVG file or VML for IE8 and older versions.

EmbeddedPNG Type

This part is designed to demonstrate how to save and output barcode image in PNG image file. And the sample code is Code 128 barcode, of course, users can change to any other compatible barcode type, for instance, Code 11, Codabar, Code 39, Code 128, MSI, Postnet, Code 2 of 5, etc.
Basic information for PNG image: still known as Portable Network Graphics, PNG is a bitmap image file format for the lossless, portable, well-compressed storage of raster (bitmap) images. PNG can be used in many fields, and image-editing and transferring images on the Internet are two major uses.
ASP.NET codes for outputting PNG type:
<kettic:PerBarcoderunat="server"ID="PerBarcode1"Type="Code128"Text="12345678"OutputType="EmbeddedPNG">
</kettic:PerBarcode>
Sample C# codes for EmbeddedPNG type:

PerBarcode1.OutputType = BarcodeOutputType.EmbeddedPNG;

SVG_VML Type

After have been familiar with EmbeddedPNG type, let's come to setting SVG_VML Type. With the rich option from Kettic barcode creating and saving components, we can also create and output barcode in SVG_VML type.
Different from raster PNG image, SVG is a vector image form. SVG, the short form of Scalable Vector Graphics, is an XML-based vector image format for two-dimensional graphics with support for interactivity and animation. And SVG image can keep the same no matter it is magnified in how many times.
See ASP.NET codes for SVG_VML type:
<kettic:PerBarcoderunat="server"ID="PerBarcode1"Type="Code128"Text="12345678"OutputType="SVG_VML">
</kettic:PerBarcode>
See C# sample codes for outputting SVG_VML type:
PerBarcode1.OutputType = BarcodeOutputType.SVG_VML;

Return System.Drawing.Image

The output image can be created using GetImage() method of the PerBarcode control. Users can get the returned System.Drawing. Bitmap object to save image later and the image size depends on the LineWidth (DotSize) set for the Barcode.
publicvoidGetWebImage()
{
PerBarcode barcode = newPerBarcode();
barcode.Type = Kettic.ASPX.Controls.BarcodeType.Code128;
barcode.Text = "12345678";
barcode.LineWidth = 3;

System.Drawing.Imageiamge = barcode.GetImage();
}
ASP.NET AJAX UI Controls