Neodynamic Barcode Professional 3.0 for Windows Forms
Microsoft .NET Framework (all versions)
Creating TIFF (Tagged Image File Format) barcodes using C# or VB.NET and Barcode Professional for Windows Forms is a very simple task. In the following lines we'll describe some common scenarios about TIFF barcodes generation.
Private Sub SaveBarcode()
'Create a Barcode Professional object
Dim bcp As New Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional()
'Set the barcode symbology to Code 128
bcp.Symbology = Neodynamic.WinControls.BarcodeProfessional.Symbology.Code128
'Set the value to encode
bcp.Code = "1234567890"
'Barcode dimensions settings (values measured in inches)
bcp.BarHeight = 1.5F
bcp.BarWidth = 0.02F
'Resolution
Dim dpi As Single = 300.0F
'Save the TIFF barcode image on disk
bcp.Save("C:\barcode128.tif", System.Drawing.Imaging.ImageFormat.Tiff, dpi, dpi)
End Sub
private void SaveBarcode()
{
//Create a Barcode Professional object
Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional bcp = new Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional();
//Set the barcode symbology to Code 128
bcp.Symbology = Neodynamic.WinControls.BarcodeProfessional.Symbology.Code128;
//Set the value to encode
bcp.Code = "1234567890";
//Barcode dimensions settings (values measured in inches)
bcp.BarHeight = 1.5f;
bcp.BarWidth = 0.02f;
//Resolution
float dpi = 300.0f;
//Save the TIFF barcode image on disk
bcp.Save(@"C:\barcode128.tif", System.Drawing.Imaging.ImageFormat.Tiff, dpi, dpi);
}
Private Sub SaveBarcode()
'Create a Barcode Professional object
Dim bcp As New Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional()
'Set the barcode symbology to Code 128
bcp.Symbology = Neodynamic.WinControls.BarcodeProfessional.Symbology.Code128
'Set the value to encode
bcp.Code = "1234567890"
'Barcode dimensions settings (values measured in inches)
bcp.BarHeight = 1.5F
bcp.BarWidth = 0.02F
'Monochrome (Black and White 1 bit per pixel)
bcp.Monochrome = True
'Resolution
Dim dpi As Single = 300.0F
'Save the TIFF barcode image on disk
bcp.Save("C:\barcode128_BW1bpp.tif", System.Drawing.Imaging.ImageFormat.Tiff, dpi, dpi)
End Sub
private void SaveBarcode()
{
//Create a Barcode Professional object
Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional bcp = new Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional();
//Set the barcode symbology to Code 128
bcp.Symbology = Neodynamic.WinControls.BarcodeProfessional.Symbology.Code128;
//Set the value to encode
bcp.Code = "1234567890";
//Barcode dimensions settings (values measured in inches)
bcp.BarHeight = 1.5f;
bcp.BarWidth = 0.02f;
//Monochrome (Black and White 1 bit per pixel)
bcp.Monochrome = true;
//Resolution
float dpi = 300.0f;
//Save the TIFF barcode image on disk
bcp.Save(@"C:\barcode128_BW1bpp.tif", System.Drawing.Imaging.ImageFormat.Tiff, dpi, dpi);
}
Private Function GetTiffBarcode() As Byte()
'Create a Barcode Professional object
Dim bcp As New Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional()
'Set the barcode symbology to Code 128
bcp.Symbology = Neodynamic.WinControls.BarcodeProfessional.Symbology.Code128
'Set the value to encode
bcp.Code = "1234567890"
'Barcode dimensions settings
bcp.BarHeight = 1.5F
bcp.BarWidth = 0.02F
'Resolution
Dim dpi As Single = 300.0F
'Get the TIFF barcode image in binary format
Return bcp.GetBarcodeImage(System.Drawing.Imaging.ImageFormat.Tiff, dpi)
End Function
private byte[] GetTiffBarcode()
{
//Create a Barcode Professional object
Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional bcp = new Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional();
//Set the barcode symbology to Code 128
bcp.Symbology = Neodynamic.WinControls.BarcodeProfessional.Symbology.Code128;
//Set the value to encode
bcp.Code = "1234567890";
//Barcode dimensions settings
bcp.BarHeight = 1.5f;
bcp.BarWidth = 0.02f;
//Resolution
float dpi = 300.0f;
//Get the TIFF barcode image in binary format
return bcp.GetBarcodeImage(System.Drawing.Imaging.ImageFormat.Tiff, dpi);
}
Private Function GetTiffBarcode() As String
'Create a Barcode Professional object
Dim bcp As New Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional()
'Set the barcode symbology to Code 128
bcp.Symbology = Neodynamic.WinControls.BarcodeProfessional.Symbology.Code128
'Set the value to encode
bcp.Code = "1234567890"
'Barcode dimensions settings
bcp.BarHeight = 1.5F
bcp.BarWidth = 0.02F
'Resolution
Dim dpi As Single = 300.0F
'Get the TIFF barcode image in binary format
Dim buffer() as Byte = bcp.GetBarcodeImage(System.Drawing.Imaging.ImageFormat.Tiff, dpi)
'Convert to Base64
Return Convert.ToBase64String(buffer)
End Function
private string GetTiffBarcode()
{
//Create a Barcode Professional object
Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional bcp = new Neodynamic.WinControls.BarcodeProfessional.BarcodeProfessional();
//Set the barcode symbology to Code 128
bcp.Symbology = Neodynamic.WinControls.BarcodeProfessional.Symbology.Code128;
//Set the value to encode
bcp.Code = "1234567890";
//Barcode dimensions settings
bcp.BarHeight = 1.5f;
bcp.BarWidth = 0.02f;
//Resolution
float dpi = 300.0f;
//Get the TIFF barcode image in binary format
byte[] buffer = bcp.GetBarcodeImage(System.Drawing.Imaging.ImageFormat.Tiff, dpi);
//Convert to Base64
return Convert.ToBase64String(buffer);
}
We provide best-in-class customer service and support directly from members of our dev team! If we are available when you contact us, you will get a response in few minutes; otherwise the maximum turnaround is 24hs in most cases.