QR Code Size Setting Instruction
Generating and Scanning QR Code Barcodes
OnBarcode provides comprehensive QR Code barcode generator and scanner components for Java, .NET, Android, iOS developments and several reporting applications.
QR Code Barcode Generation Controls
QR Code Barcode Scanner Controls
QR Code Barcode Generator & Reader Software
How to generate, print barcode using .NET, Java sdk library control with example project source code free download:
QR Code Structure
- W : the width of QR Code image (including quiet zone).
- H : the height of QR Code image (including quiet zone).
- X : the width of QR Code module.
- Q : the width of the quiet zone; Q = 4X.
QR Code Image Size
QR Code image has 40 Versions, ranging from Version 1 to Version 40. So, there are 40 sizes of QR Code in all and the size begins from 21 X 21 modules and up to 177 X 177 modules (not including quiet zone), increasing in steps of 4 modules per side.
- V : the version of QR Code, ranging from Version 1 to Version 40.
The QR Code barcode width, W (measured in pixel), including quiet zone, can be computed from the following expression:
W = [ 8 * 2 + ( 4V + 1) ] X + 2Q
W is equal to the value of QR Code image height (H).
Then the minimum value of W can be calculated as below:
V min = 1 , X min = 1 , Q = 4X .
W min = [ 8 * 2 + ( 4V + 1 ) ] X + 2Q
= [ 16 + 5 ] X + 2 * 4X
= 21X + 8X
= 29X
= 29 pixel
So, QR Code image size is determined as long as the image version and module size are determined. The steps below can be used to obtain QR Code version and calculate the image size.
- Make certain the data to be encoded.
- Specify the error correction level of QR Code.
- Refer to QR Code Version and Maximum Data Capacity Table and choose the smallest version that accommodates your input data.
- Calculate the QR Code image width (W) from the following expression:
W = [ 8 * 2 + ( 4V + 1) ] X + 2Q
W is equal to the value of QR Code image height (H).
For instance, you need to encode 100 numeric characters into a QR Code:
- Set the error correction level to be "L".
- In the reference table, the Version 3 with level L is able to encode 100 or more numeric characters (up to 127 characters).
- Then, the image width including quiet zone should be computed as below:
- Calculate the QR Code image width (W) from the following expression:
W = [ 8 * 2 + ( 4V + 1) ] X + 2Q // V = 3
= [ 16 + 13 ] X + 2Q // Q = 4X
= 29X + 2 * 4X
= 29X + 8X
= 37X
W min = 37X // X = 1
= 37 pixel
H min = 37 pixel
OnBarcode provides details of
QR Code Barcode Size Setting in C#.