Detailed C# developer guide to create, customize barcode with required barcode dimension size using C# barcode generator
Quick to create, customize 2d barcode size in C#
When you are creating QR Code or barcodes using BarcodeLib C# barcode library, the barcode generator library will generate a barcode image with default barcode dimension width and height.
The default barcode size is decided by barcode format, input encoding data length.
The C# example code below shows how to create a QR Code encoding a site url data with default dimension width/height. (The printed barcode image is in 336 pixels x 336 pixels)
1D barcode dimesnsion size setting is similar with QR Code and other 2d barcodes. However sometimes you need customize the printed barcode text below the bar modules.
Here we use the C# codes below to create a Code 128 barcode image with default barcode module and text width and height in the C# program.
The printed barcode image size is 572 pixels in width, and 250 pixels in height.
Here we will resize the generated Code 128 barcode image width to 200 pixel through barcode property ImageWidth. And the printed barcode
image height will be automatically resized to 87 pixels.
ResizeImage. Default is true. If true, the barcode library will choose the maximum bar module width and height, based on the default or specified ImageWidth, ImageHeight, barcode format, encoding data length.
ResizeText: Default is true. If true, the barcode library will ignore the text size related settings, and automatically choose the right font size.
UOM: Unit of measure. You can choose one of the following values: "PIXEL", "INCH", "CM". The default value is Pixel.
ImageWidth: The generated barcode image width.
ImageHeight: The generated barcode image height.
BarWidth: The generated barcode module width. If ResizeImage is true, the property will be ignored.
BarHeight: The generated barcode module height. If ResizeImage is true, the property will be ignored.
LeftMargin: Default is 0f. The margin space on the left side of the bar modules.
RightMargin: Default is 0f. The margin space on the right side of the bar modules.
TopMargin: Default is 0f. The margin space on the top of the bar modules.
BottomMargin: Default is 0f. The margin space on the bottom of the bar modules.
TextMargin: For 1d barcode formats only, the margin space between bar modules and text label.
TextFont: For 1d barcode formats only, The font size settings.
Barcode for Visual C#.NET - Other Supported Barcodes