See Also
Other Platforms
Features
Buy Now
Online Help
Demo
Licensing

Back

How to create and save barcode images in Pocket PC, Smartphone, Windows CE and Windows Mobile projects

Prerequisites
  • Neodynamic Barcode Professional for .NET Compact Framework
  • Microsoft .NET Compact Framework 2.0 (or greater)
  • Microsoft Visual Studio 2005 (or greater)
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.
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:
      Visual Basic .NET
      '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)
      Visual C# .NET
      //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:
      Visual Basic .NET
      '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.ImageFormat.Bmp)
      Visual C# .NET
      //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);
If you need more information or assistance, please contact our .
 Copyright © 2003 - 2010 Neodynamic S.R.L. All rights reserved.