Data Matrix PCL Code For .NET


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Data Matrix PCL Code For .NET

Hybrid View

  1. #1
    Join Date
    May 2013
    Posts
    1

    Data Matrix PCL Code For .NET

    Now I am creating Data Matrix in VB.NET. Here is a sample code to have a try:
    Code:
    Imports OnBarcode.Barcode
    
    Dim barcode As DataMatrix = New DataMatrix
    
    ' Data Matrix Barcode Basic Settings
    
    barcode.Data = "112233445566"
    
    barcode.DataMode = DataMatrixDataMode.ASCII
    
    'if your selected format mode doesnot have enough space to encode your data, 
    'the library will choose the right format mode for you automatically.
    barcode.FormatMode = DataMatrixFormatMode.Format_48X48
    
    'Set the ProcessTilde property to true, if you want use the tilde character "~" 
    'to specify special characters in the input data. Default is false.
    
    '1) 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255); 
    '   ASCII character '~' is presented by ~126;
    '   Strings from "~256" to "~299" are unused
    '   modified to FS, GS, RS and US respectively.
    '2) 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535)
    '   Strings from "~665536" to "~699999" are unused
    '3) for GS1 AI Code: 
    '   ~ai2: AI with 2 digits
    '   ~ai3: AI with 3 digits
    '   ~ai4: AI with 4 digits
    '   ~ai5: AI with 5 digits
    '   ~ai6: AI with 6 digits
    '   ~ai7: AI with 7 digits
    '4) ECI: ~7dddddd (valid value of dddddd from 000000 to 999999)
    '5) ~rp: Reader Programming (for ASCII mode and Auto mode only)
    '6) ~m5: 05 Macro (for ASCII mode and Auto mode only)
    '7) ~m6: 06 Macro (for ASCII mode and Auto mode only)
    barcode.ProcessTilde = True
    
    ' Barcode Size Related Settings
    barcode.UOM = UnitOfMeasure.PIXEL
       barcode.X = 3
    barcode.LeftMargin = 0
       barcode.RightMargin = 0
    barcode.TopMargin = 0
       barcode.BottomMargin = 0
    barcode.Resolution = 96
       barcode.Rotate = Rotate.Rotate0
    
    ' Image format setting
    barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif()
    
    barcode.drawBarcode("c://data-matrix.gif")
    Last edited by Hack; 05-20-2013 at 06:56 AM. Reason: Added Code Tags

  2. #2
    Join Date
    Oct 2013
    Posts
    1
    Quote Originally Posted by petesfw View Post
    Now I am creating Data Matrix in VB.NET. Here is a sample code to have a try:
    Code:
    Imports OnBarcode.Barcode
    
    Dim barcode As DataMatrix = New DataMatrix
    
    ' Data Matrix Barcode Basic Settings
    
    barcode.Data = "112233445566"
    
    barcode.DataMode = DataMatrixDataMode.ASCII
    
    'if your selected format mode doesnot have enough space to encode your data, 
    'the library will choose the right format mode for you automatically.
    barcode.FormatMode = DataMatrixFormatMode.Format_48X48
    
    'Set the ProcessTilde property to true, if you want use the tilde character "~" 
    'to specify special characters in the input data. Default is false.
    
    '1) 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255); 
    '   ASCII character '~' is presented by ~126;
    '   Strings from "~256" to "~299" are unused
    '   modified to FS, GS, RS and US respectively.
    '2) 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535)
    '   Strings from "~665536" to "~699999" are unused
    '3) for GS1 AI Code: 
    '   ~ai2: AI with 2 digits
    '   ~ai3: AI with 3 digits
    '   ~ai4: AI with 4 digits
    '   ~ai5: AI with 5 digits
    '   ~ai6: AI with 6 digits
    '   ~ai7: AI with 7 digits
    '4) ECI: ~7dddddd (valid value of dddddd from 000000 to 999999)
    '5) ~rp: Reader Programming (for ASCII mode and Auto mode only)
    '6) ~m5: 05 Macro (for ASCII mode and Auto mode only)
    '7) ~m6: 06 Macro (for ASCII mode and Auto mode only)
    barcode.ProcessTilde = True
    
    ' Barcode Size Related Settings
    barcode.UOM = UnitOfMeasure.PIXEL
       barcode.X = 3
    barcode.LeftMargin = 0
       barcode.RightMargin = 0
    barcode.TopMargin = 0
       barcode.BottomMargin = 0
    barcode.Resolution = 96
       barcode.Rotate = Rotate.Rotate0
    
    ' Image format setting
    barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif()
    
    barcode.drawBarcode("c://data-matrix.gif")
    Thanks for your nice ionfo. But using code to deal with the related problem is too complicated for me. I will try it later.



    Best regards,
    Arron

  3. #3
    Join Date
    Oct 2013
    Posts
    1
    Thanks petesfw your code help me , so I get what I need .

  4. #4
    Join Date
    Dec 2013
    Posts
    16
    I was trying to generate data matrix in VB.NET with the code you posted. The images came but the width and height of the barocde remained the same no matter what numbers I put in the source code to replace. Any idea why and how to solve it. Please.

Similar Threads

  1. 2D (Data matrix) PCL
    By wavp in forum VB Classic
    Replies: 2
    Last Post: 01-16-2013, 03:09 AM
  2. c++ source code matrix
    By starks in forum C++
    Replies: 3
    Last Post: 05-24-2005, 09:15 AM
  3. Replies: 0
    Last Post: 02-05-2002, 08:53 AM
  4. Matrix data type+
    By Mike in forum C++
    Replies: 6
    Last Post: 03-27-2001, 05:20 AM
  5. Replies: 2
    Last Post: 03-22-2001, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center