How to create and save barcode images in Pocket PC, Smartphone, Windows CE and Windows Mobile projects
Product Barcode Professional for .NET Compact Framework Published 04/30/2007 Updated 04/30/2007
Overview
This walkthrough illustrates how to generate and save linear (1D) and 2D barcode images in Smart Device projects such as Pocket PC, Smartphone, Windows CE and Windows Mobile.
Requirements
Neodynamic Barcode Professional for .NET Compact Framework
Microsoft .NET Compact Framework 2.0 (or greater)
Microsoft Visual Studio 2005 (or greater)
Neodynamic Barcode Professional for .NET Compact Framework features an overloaded method called Save which lets you to locally save the generated barcode image.
Examples:
- Generating and saving Linear (1D) barcodes, for example Code 39
- Open Visual Studio and in a Smart Device project like Pocket PC, please add a reference to Neodynamic.CF.Barcode1D.dll assembly
- Then, write the following in some place of your code that in summary will generate and save a Code 39 barcode image:
VB
'Create a Barcode1D object Dim bc As New Neodynamic.CF.Barcode1D.Barcode1D() 'Set barcode symbology bc.Symbology = Neodynamic.CF.Barcode1D.Symbology1D.Code39 'Set value to encode bc.Code = "ABC123456789" 'Set dimensions bc.BarWidth = 0.01F bc.BarHeight = 0.5F '... 'Generate and save the barcode image bc.Save("\My Documents\Personal\Code39Test.bmp", System.Drawing.Imaging.ImageFormat.Bmp)C#
//Create a Barcode1D object Neodynamic.CF.Barcode1D.Barcode1D bc = new Neodynamic.CF.Barcode1D.Barcode1D(); //Set barcode symbology bc.Symbology = Neodynamic.CF.Barcode1D.Symbology1D.Code39; //Set value to encode bc.Code = "ABC123456789"; //Set dimensions bc.BarWidth = 0.01f; bc.BarHeight = 0.5f; //... //Generate and save the barcode image bc.Save(@"\My Documents\Personal\Code39Test.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
- Generating and saving 2D barcodes, for example Data Matrix
- Open Visual Studio and in a Smart Device project like Pocket PC, please add a reference to Neodynamic.CF.Barcode2D.dll assembly
- Then, write the following in some place of your code that in summary will generate and save a Data Matrix barcode image:
VB
'Create a Barcode2D object Dim bc As New Neodynamic.CF.Barcode2D.Barcode2D() 'Set barcode symbology bc.Symbology = Neodynamic.CF.Barcode2D.Symbology2D.DataMatrix 'Set value to encode bc.Code = "ABC123456789" 'Set dimensions bc.DataMatrixModuleSize = 0.04F '... 'Generate and save the barcode image bc.Save("\My Documents\Personal\DataMatrixTest.bmp", System.Drawing.Imaging.ImageFormatC#
//Create a Barcode2D object Neodynamic.CF.Barcode2D.Barcode2D bc = new Neodynamic.CF.Barcode2D.Barcode2D(); //Set barcode symbology bc.Symbology = Neodynamic.CF.Barcode2D.Symbology2D.DataMatrix; //Set value to encode bc.Code = "ABC123456789"; //Set dimensions bc.DataMatrixModuleSize = 0.04f; //... //Generate and save the barcode image bc.Save(@"\My Documents\Personal\DataMatrixTest.bmp", System.Drawing.Imaging.ImageFormat.Bmp);
Need help? Contact Support
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.