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.
How to Generate Data Matrix
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.
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.
// 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()