Class QrCode
QR Code (ISO/IEC 18004) model 2, versions 1-40, all error correction levels. Numeric, alphanumeric and byte (UTF-8) mode are selected automatically.
public sealed class QrCode : MatrixBarcode
- Inheritance
-
QrCode
- Inherited Members
Examples
var qr = QrCode.Create("https://example.com");
canvas.DrawBarcode(qr, 450, 700, 80); // 80 x 80 pt
Properties
ErrorCorrection
The error correction level used.
public QrErrorCorrection ErrorCorrection { get; }
Property Value
Mask
The mask pattern used (0-7).
public int Mask { get; }
Property Value
Version
The symbol version (1-40); the size is 17 + 4 * version modules.
public int Version { get; }
Property Value
Methods
Create(string, QrCodeOptions)
Creates a QR Code of the smallest version between MinVersion and
MaxVersion that holds text. The quiet zone is 4 modules.
public static QrCode Create(string text, QrCodeOptions options)
Parameters
textstringoptionsQrCodeOptions
Returns
Exceptions
- ArgumentException
textdoes not fit into the allowed versions.
Create(string, QrErrorCorrection)
Creates a QR Code of the smallest version that holds text at the given error correction level.
public static QrCode Create(string text, QrErrorCorrection errorCorrection = QrErrorCorrection.M)
Parameters
textstringerrorCorrectionQrErrorCorrection
Returns
Exceptions
- ArgumentException
textis too long for a QR Code.