Our Customers
Contact Us Email: support@barcodelib.com
Home > .NET Barcode > C# Barcode Generation Guide > C# Data Matrix Generator Component for .NET
Download Barcode for .NET Suite Trial

Data Matrix Generator Library for .NET in C# Class

How to Generate 2D Data Matrix Barcodes in .NET with C# Programming
  • 100% built in Visual C#, compatible with .NET Framwork 2.0, 3.0, 3.5, 4.0 and later
  • Run perfectly in many .NET Framework applications, like WinForms and ASP.NET
  • Create high-quality Data Matrix barcode images with C# codes in .NET
  • Insert & draw Data Matrix barcodes in Crystal Reports and RDLC Reports
  • Save generated Data Matrix barcodes as image files without using barcode fonts
  • Suitable for other linear & 2D barcodes generation, like EAN13, Code 128, QR Code, etc
C# 2D Data Matrix Barcode Introduction
Data Matrix is a 2 dimensional (2D) matrix barcode symbology, with high-density data and strong error correction ability. It has two types-ECC 200 and ECC000-140. In the real daily life, ECC200 is more widely used.
How to Generate Data Matrix Images in C#.NET Class?
You could produce a high-quality Data Matrix image by referring to the following steps:
  1. Add Barcodelib.Barcode.ASP.NET.dll to your web project.
  2. Add Barcodelib.Barcode.ASP.NET.dll to the Toolbox.
  3. Then, use the following free C# sample codes to generate Data Matrix.
     BarcodeLib.Barcode.DataMatrix datamatrix = new BarcodeLib.Barcode.DataMatrix();
datamatrix.Data = "1dfefg%^7fdsg56566";

datamatrix.BackgroundColor = System.Drawing.Color.White;
datamatrix.ModuleSize =6;
datamatrix.RightMargin = 6;
datamatrix.ImageFormat = System.Drawing.Imaging.ImageFormat.Jpeg;

// More datamatrix barcode settings here, like image color, font, human-readable text font etc.

// save barcode image into your system

// Encode datamatrix barcode & output to byte array
byte[] barcodeInBytes = datamatrix.drawBarcodeAsBytes();

// Encode datamatrix barcode to Graphics object
Graphics graphics = ...;

// Encode datamatrix barcode and output to HttpResponse object
HttpResponse response = ...;
datamatrix drawBarcode(response);

// Encode datamatrix barcode and output to Stream object
Stream stream = ...;
datamatrix drawBarcode(stream);
Above Free Data Matrix sample codes are written in Visual C# 2005
How to Create Data Matrix Barcodes in C# ASP.NET Web Project?
Our C# Data Matrix Barcodes Generator Library also allows users to generate Data Matrix in ASP.NET Web Project. The following are detailed steps:
  1. Add Barcodelib.Barcode.ASP.NET.dll to your web project.
  2. Add Barcodelib.Barcode.ASP.NET.dll to the Toolbox.
  3. Copy files "datamatrix.aspx" & "datamatrix.aspx.cs" from the folder barcode in the downloaded trial package to the folder where your web project is located.
  4. Drag DataMatrixASPNET from the toolbox to the split part of your aspx page, and then change its settings in the Properties window or with above C# source code.
How to Generate Data Matrix Barcodes in C# WinForms Project?
You may use our C# Generator DLL to create a Data Matrix image in WinForms Project with following steps:
  1. Add BarcodeLib.Barcode.WinForms.dll from the downloaded trial package to your WinForms Project.
  2. Add BarcodeLib.Barcode.WinForms.dll to your Visual Studio Toolbox.
  3. Drag DataMatrixWinForm to your windows form and a Data Matrix barcode will be produced or you could use above free C# source code to create Data Matrix.
Barcode Generator Component for C# Supported Barcode Images
C# 1D Barcode Generation:
C# 2D Barcode Generation:
Barcode Component for C# - Generates 1D Barcodes: Codabar, Code 11, Code 2 of 5, Code 39, Code 93, EAN-8, EAN-13, Interleaved 2 of 5, ITF-14 (UPC Shipping Container Symbol), Code 128, EAN 128/GS1 128, MSI Plessey, Intelligent Mail, Planet, Postnet, RM4SCC (British Royal Mail), UPC-A, UPC-E.
Barcode Component for C# - Generates 2D Barcodes: Data Matrix, PDF 417, QR Code.