QR Code
The QR Code is a two-dimensional barcode. A QR code uses four standardized encoding modes (numeric, alphanumeric, byte/binary, and kanji) to store data efficiently. Dirty or damaged QR Codes can apply error correction to restore data. There are four error correction levels available. Raising the correction level improves error correction capability and increases QR Code size.
Encoding
There are four standardized encoding modes supported.
- Numeric Encoding - Numeric mode encodes data from the decimal digit set (0 - 9) (byte values 30HEX to 39HEX).
- Alphanumeric - Alphanumeric mode encodes data from a set of 45 characters, i.e. 10 numeric digits (0 - 9) (byte values 30HEX to 39HEX), 26 alphabetic characters (A - Z) (byte values 41HEX to 5AHEX) , and 9 symbols (SP, $, %, *, +, -, ., /, :) (byte values 20HEX, 24HEX, 25HEX, 2AHEX, 2BHEX, 2D to 2FHEX, 3AHEX respectively).
- Byte - In this mode, data is encoded at 8 bits per character.
- Kanji - The Kanji mode efficiently encodes Kanji characters in accordance with the Shift JIS system based on JIS X 0208. The Shift JIS values are shifted from the JIS X 0208 values. JIS X 0208 gives details of the shift coded representation.
DynamicBarcode Creator supports setting a QR code's encoding using the QRCodeEncoding enumeration to set the property in the QRCode class.
Error Correction Level
There are also four error correction levels.
L - 7% Error Recovery.
M - 15% Error Recovery.
Q - 25% Error Recovery.
H - 30% Error Recovery.
DynamicBarcode creator supports setting a QR code's error correction using the QRCodeErrorCorrectionLevel enumeration to set the property in the QRCode class.
Setting Encoding and Error correction in DynamicBarcode Creator
The following example illustrates setting an encoding and error correction level using DynamicBarcode Creator.
QRCode barcode = new QRCode("Hello world", QRCodeEncoding.Auto, QRCodeErrorCorrectionLevel.L);
Dim barcode AS QRCode = New QRCode("Hello world", QRCodeEncoding.Auto, QRCodeErrorCorrectionLevel.L);
Version
The following example illustrates creating a QRCode (21 x 21 to 177 x 177 from version 1 to version 40 respectively).
QRCode barcode = new QRCode("Hello World");
barcode.Draw(pngFilePath, 300, ImageFormat.Png);
Dim barcode As QRCode = New QRCode("Hello World")
barcode.Draw(pngFilePath, 300, ImageFormat.Png)