| Aspose.BarCode facilitates its developers to save the barcode images to most of the popular image formats. All barcode generating classes (BarCodeBuilder, BarCodeControl or BarCodeWebControl) provided by Aspose.BarCode, have a public method, Save.
Save method takes an instance of System.Drawing.Imaging.ImageFormat class (which is the part of Microsoft .NET Framework). Following image formats can be passed to Save method of the barcode class as an argument: Developers can use any of the image format from the above list to create a barcode image in a desired image format. An example is given below about its usage. |
| Aspose.BarCode for Java only supports Jpg, Gif, Png and Bmp. |
Programming Sample
[C#]
//Instantiate barcode object
BarCodeBuilder bb = new BarCodeBuilder();
//Set the Code text for the barcode
bb.CodeText = "1234567";
//Set the symbology type to Code128
bb.SymbologyType = Symbology.Code128;
//Save the image to your system and set its image format to Jpeg
bb.Save("barcode.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
[VB.NET]
'Instantiate barcode object
Dim bb As BarCodeBuilder = New BarCodeBuilder()
'Set the Code text for the barcode
bb.CodeText = "1234567"
'Set the symbology type to Code128
bb.SymbologyType = Symbology.Code128
'Save the image to your system
'and set its image format to Jpeg
bb.Save("barcode.jpg",
System.Drawing.Imaging.ImageFormat.Jpeg)
The output barcode image (in Jpeg format) generated by the code above can be seen in the below figure:
Figure: Barcode image in Jpeg format
[C#]
//Instantiate barcode object BarCodeBuilder bb = new BarCodeBuilder(); //Set the Code text for the barcode bb.CodeText = "1234567"; //Set the symbology type to Code128 bb.SymbologyType = Symbology.Code128; //Save the image to your system and set its image format to Jpeg bb.Save("barcode.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
[VB.NET]
'Instantiate barcode object Dim bb As BarCodeBuilder = New BarCodeBuilder() 'Set the Code text for the barcode bb.CodeText = "1234567" 'Set the symbology type to Code128 bb.SymbologyType = Symbology.Code128 'Save the image to your system 'and set its image format to Jpeg bb.Save("barcode.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
The output barcode image (in Jpeg format) generated by the code above can be seen in the below figure:
Figure: Barcode image in Jpeg format
