QR Code Image Sample - pqScan.com
.NET Data Matrix Barcode Creator Encoding Data Matrix Image in .NET Online Demo Download Trial Purchase Now

How to Generate Data Matrix

back to home  >  .NET Barcode Generator SDK  >  Generate Barcodes in .NET  >  Generate Data Matrix in .NET

Generating Data Matrix in .NET is one of the roles in pqScan .NET Barcode Creator, which can create Data Matrix barcode and some other 2D barcodes, such as encoding QR Code, generating Aztec Code and making PDF 417.

Users can create Data Matrix using the component API in C#/VB.NET code(). If you don't want to write code yourself, render a Data Matrix image through a barcode control in WebForms and Winforms is not a bad choice.

More about Data Matrix

Data Matrix, usually in square shape, is a 2D matrix barcode. It's most used in marking small items. What's more, Data Matrix is also worked on printed media and in the food industry.

Useful encoding Data Matrix properties

BarType: To encode a Data Matrix barcode, set barcode type to DataMatrix.

Data: All 128 characters of ASCII, and 128-255 in accordance with ISO 8859-1 which are referred to as extended ASCII.

DataMatrixShape: Render Data Matrix in a Rectangle shape or a Square shape. Default is Auto Mode.

Width: It's barcode image width. Data Matrix's module size will be the most suitable value automatically though this width. So there may be some left and right margin in the Data Matrix barcode image.

Height: It's barcode image height. Drawing Data Matrix will make an utmost effort to meet this height. Top and bottom margin may appear in the Data Matrix image.

BarcodeColor: Customize the foreground color of Data Matrix barcode image. Default is Black color.

BackgroundColor: Customize the background color of Data Matrix barcode image. Default is White color.

PictureFormat: Render barcode image as Bmp, Png, Jpeg, Tiff, Gif format.

Useful encoding Data Matrix Methods

// encode data matrix and paint on Bitmap object
public Bitmap CreateBarcode()

// create and generate data matrix to image file
publicvoid CreateBarcode(string filename)

// create data matrix and print on Stream object
publicvoid CreateBarcode(Stream stream)

// generate data matrix and draw to byte[] object
publicbyte[] CreateBarcodeInBytes()
.NET Barcode Creator QR Code Creator in .NET PDF 417 Creator in .NET Aztec Code Creator in .NET EAN 13 Creator in .NET EAN 8 Creator in .NET UPC A Creator in .NET Code 128 Creator in .NET Code 39 Creator in .NET