VB.NET QR Code Generator Size Setting Tutorial
sample source code to generate linear QR Code images and adjust barcode size in VB.NET
- .NET Component with QR Code barcode image generation functionality
- Ready to be used and reused in VB.NET IDEs
- Provide property to set the unit of measure
- Support cell size setting
- Control size of the symbol using intelligent property
- Add margins around the symbol
- Compatible with ISO / IEC 16022 (2nd edition 2006-09-15)
QR Code, also known as Denso Barcode, QRCode, Quick Response Code, is a kind of 2D (two dimensional) barcode widely used today.
QR Code Symbology Structure
W: the width of QR Code image, including quiet zone, controlled by property BarCodeWidth
H: the height of QR Code image, including quiet zone, controlled by property BarCodeHeight
X (X ≥ 1 pixel): the width and height of the cell, controlled by property X
Q (Q ≥ 4X): the width of the quiet zone, related to property LeftMargin & RightMargin
More information about QR Code barcode settings in Excel Barcode Generator,please see:
QR Code VB.NET Generator Size Setting Tutorial
After QR Code VB.NET Generator installation, get it ready in VB.NET by placing the following statement:
Dim qrcode As OnBarcode.Barcode. QRCode
qrcode = New OnBarcode.Barcode. QRCode
There are 40 versions for QR Code size setting. Different versions stand for different numbers of modules in one QR Code.
qrcode.Version = OnBarcode.Barcode.QRCodeVersion.V1
UOM is the controller of size setting unit. Pixel, Cm, and Inch are provided as its options. The default value of UOM is Pixel. For example, type the following statement to select Pixel as the unit of size setting measure:
qrcode.UOM = OnBarcode.Barcode.UnitOfMeasure.PIXEL
Property X (Type: Float; Default: 1) is used for the module width and height setting.
qrcode.X = 2
BarCodeHeight & BarCodeWidth
Property BarCodeHeight (Type: Float; Default: 0) and Property BarCodeWidth (Type: Float; Default: 0) to set the size of the whole image.
qrcode.BarcodeHeight = 175
qrcode.BarcodeWidth = 175
When the value of X, BarCodeWidth, and BarCodeHeight conflict with each other, Property AutoResize (Type: bool; Default: False) should be enabled to solve the problem and make the QR Code 100% compatible with its symbology specification and ISO 16022. See QR Code Barcode Size in VB.NET to know more usage of AutoResize.
qrcode.X = 2
qrcode.BarcodeHeight = 60
qrcode.AutoResize = True
TopMargin, BottomMargin, LeftMargin, & RightMargin
Using QR Code VB.NET Generator, a quiet zone with 10X width will be generated automatically at each side of the QR Code. When wider quiet zone is needed, you can increase the value of properties LeftMargin (Type: Float; Default: 0) and RightMargin (Type: Float; Default: 0). You can also create margins using TopMargin (Type: Float; Default: 0) and BottomMargin (Type: Float; Default: 0).
qrcode.TopMargin = 10
qrcode.BottomMargin = 10
qrcode.LeftMargin = 10
qrcode.RightMargin = 10