BizCode Generator for .NET Ultimate
The most robust & powerful barcode generating SDK for Microsoft .NET Framework
Quick Overviews
  • Mature barcode creating SDK
  • Support .NET 2.0/3.0/4.0
  • 100% developed in C#.NET
  • Dynamic barcodes support
  • User-defined controls provided
How to Set Data Matrix Size in C#
C#.NET Data Matrix Generator is one function of BizCode Generator for .NET Ultimate, which is a professional barcode generating SDK full of advanced barcode creating and printing features. This generator can completely run in C#.NET and easily integrate into any C#.NET applications & projects.
C#.NET Data Matrix Generator provides full of controls to customize Data Matrix barcode size with module size, barcode width and format. Besides, 30 different barcode format modes in square and rectangular for Data Matrix are provided for the different purpose. This document gives a complete sample coding for Data Matrix Barcode Size Setting in C#.NET; other please see:
Data Matrix Size Related Properties

Data Matrix Format Mode

Users may generate Data Matrix barcode in to square patterns (10x10 to 144x144) or rectangular (8x18 to 16x48) patterns using FormatMode property.

Barcode Unit

Users may choose three different barcode unit measurements - pixel, cm and inch to measure all barcode size related properties using BarcodeUnit property.

Quiet Margin

Users may easily change the quiet zone size of generated Data Matrix barcode using QuietMargin related property, including TopMargin, BottomMargin, RightMargin and LeftMargin.

Bar Width & Height

Users may quickly change Data Matrix barcode size through setting bar width and height using BarWidth and BarHeight property.

Barcode Width & Height

Users may set the whole barcode width and height of Data Matrix barcode using BarcodeWidth and BarcodeHeight in accordance with users' needs.
Customize Data Matrix Barcode Sizes in C#.NET
If you want to adjust Data Matrix image size in C#.NET, be sure that you have installed:
Customize Data Matrix Barcode Size in C#.NET
Copy those following code onto your C#.NET projects:
using BusinessRefinery.Barcode;

DataMatrix Barcode = new DataMatrix();
barcode.Code = "123456789";

Change Data Matrix Barcode Unit Measuirement
BarcodUnit default value in BizCode Generator for .NET Ultimate is BarcodeUnit.PIXEL.

Copy those following code to change your unit measurement for all size related properties:
barcode.BarcodeUnit = BarcodeUnit.PIXEL;
Create Data Matrix barcode in square or retangular patterns
FormatMode default value in BizCode Generator for .NET Ultimate is DataMatrixFormatMode.Format_10X10.

Copy those following code to choose Data Matrix barcode version:
barcode.FormatMode = DataMatrixFormatMode.Format_104X104;
Adjust Data Matrix Bar Width and Height
ModuleSize default value in BizCode Generator for .NET Ultimate is 3 pixel.

Copy those following code to specify your module size:
barcode.ModuleSize = 3;
Specify Data Matrix Barcode Width & Height
BarcodeWidth and BarcodeHeight default value in BizCode Generator for .NET Ultimate are 0 respectively.

Copy those following code to specify your barcode width and height:
barcode.BarcodeHeight = 100;
barcode.BarcodeWidth = 500;
Control Data Matrix Barcode Quiet Margin
BottomMargin, TopMargin , LeftMargin and RightMargin default value in BizCode Generator for .NET Ultimate is 0 respectively.

Copy those following code to change your quiet margin size:
barcode.BottomMargin = 7;
barcode.TopMargin = 7;
barcode.LeftMargin = 5;
barcode.RightMargin = 5;