|
C# QR Code Generator Property List
List of QR Code properties for QR Code generation in C# class, ASP.NET, .NET reports
- Easily generate QR-Code barcodes in .NET applications
- Compatible with the latest QR-Code ISO specification [ISO/IEC 18004 (Second edition 2006-09-01)]
- Generate high quality QR-Code images in JPEG, GIF & PNG formats
- Completely built in C# codes, compatible with .net 2.0 and later versions
- Generate QR-Code barcodes using C#, VB.NET on ASP.NET or Windows Forms
- Generate QR-Code in Crystal Reports using C#, VB.NET
- Generate QR-Code in Reporting Services using C#, VB.NET
- Professional .NET Barcode Generator component supporting all kinds of barcode settings
- One time payment for royalty-free developer license and use it for lifetime
.NET QR Code Introduction
QR-Code is also known as Denso Barcode, QRCode, Quick Response Code, JIS X 0510, ISO/IEC18004.
Compatibility: Barcode for .NET component is compatible with ISO/IEC 18004 (Second edition 2006-09-01).
QR Code is a kind of 2-D (two-dimensional) symbology developed by Denso Wave (a division of Denso Corporation at the time) and released in 1994 with the primary aim of being a symbol that is easily interpreted by scanner equipment.
QR Code is capable of handling all types of data, such as numeric and alphabetic characters, Kanji, Kana, Hiragana, symbols, binary, and control codes.
.NET QR Code Property Settings
To create and customize QR Code image in C# application, you can update and apply the QR Code property settings in
class BarcodeLib.Barcode.QRCode.
Here is a simple C# demo code to quickly create QR Code in C# program.
QRCode barcode = new QRCode();
barcode.Data = "QR Code";
barcode.drawBarcode("C:\\temp\\qrcode.png");
You can further customize the QR Code using the following properties.
Data Settings
- Set the Data property with the value to encode. Type is string.
Web Stream URL Parameter: Data.
- Set the ProcessTilde property to
true, if you want use the tilde character "~" to specify special characters in the input data. Default is false. ~NNN: is used to represent the ASCII character with the value of NNN. Web Stream URL Parameter: ProcessTilde. Valid values are: "true", or "false".
- Set the IsUnicodeData property to
true, if you need encode Unicode text in QR Code.
You can view more details about QR Code unicode text encoding here:
- Set the UnicodeMode property to choose a binary data encoding mode.
Default is DataUnicodeMode.UTF8
Most QR Code generator and scanner support UTF-8 encoding by default.
data encoding. Using BarcodeLib QR Code C# generator library, you can choose one of the following encode mode.
public enum DataUnicodeMode
{
UTF8,
UTF7,
UTF32,
Unicode,
UnicodeBE
}
Note: QR Code generators and readers must use the same binary encoding mode. UTF-8 is supported by default on most QR Code printers and scanners.
QR Code Dimension Size Settings
- Set property UOM (Unit of Measure) for properties BarWidth, BarHeight, LeftMargin and TopMargin.
Valid values are
UnitOfMeasure.Pixel (0), UnitOfMeasure.CM (1), UnitOfMeasure.Inch (2). Default is UnitOfMeasure.Pixel (0). Web Stream URL Parameter: UOM. Valid values are: 0, 1, 2.
- Set the ImageWidth and ImageHeight properties. Both types are
float.
ImageWidth default is 0. ImageHeight default is 0.
Web Stream URL Parameter: ImageWidth and ImageHeight.
The two properties define the generated QR Code image width and height. Since QR Code is in square shape,
Note: Since the QR code is square, you need to set ImageWidth and ImageHeight to the same length. You can also simply set ImageWidth, and the QR Code generator library will automatically set ImageHeight to the same value.
- Set the ResizeImage property to
true and our component will resize the barcode image if manual setting is invalid. Type is bool. Default is false. Web Stream URL Parameter: ResizeImage.
- Set the ModuleSize (for QR Code bar cell width and height)
Type is float. Default is 3 pixels. Web Stream URL Parameter: ModuleSize.
Note: If you want to manually set ModuleSize, you need to first set ResizeImage to false. When ResizeImage is true, the QR Code library will automatically calculate and select the maximum ModuleSize value.
- Set the LeftMargin, RightMargin, TopMargin and BottomMargin properties.
Types are all float. Default are 0. Web Stream URL Parameter: LeftMargin, RightMargin, TopMargin, BottomMargin.
Note: According to the QR Code ISO standard, a QR code requires a quiet zone of at least 10X (where X is the bar module size). Otherwise, the QR code may not be recognized by scanners.
- Set the Resolution property (Value is expressed in DPI - Dots per inch).
Type is int. Default is 96 dpi. Web Stream URL Parameter: Resolution.
QR Code Advanced Features
- Set the Encoding property. Default is
QRCodeEncoding.Auto.
- QRCodeEncoding.Auto: It allows encoding all 256 possible 8-bit byte values. This includes all ASCII characters value from 0 to 127 inclusive and provides for international character set support
- QRCodeEncoding.AlphaNumeric: It allows encoding alphanumeric data (digits 0 - 9; upper case letters A - Z; nine other characters: space, $ % * + - . / : ).Web Stream URL Parameter: Encoding. Valid values are: 0 (Auto), 1 (AlphaNumeric), 2 (Byte), 3 (Numeric), 4 (Kanji).
- QRCodeEncoding.Byte: It allows encoding byte data (default: ISO/IEC 8859-1).
- QRCodeEncoding.Numeric: It allows encoding numeric data (digits 0 - 9).
- QRCodeEncoding.Kanji: It allows encoding Kanji characters.
- Set the Version property. Default is QRCodeVersion.V1.
About Version and Symbology Size Web Stream URL Parameter: Version. Valid values are: (int)QRCodeVersion
- Set the ECL property. QRCode Error Correction Level. Default is QRCodeErrorCorrectionLevel.L (0).
About Error Correction Level Web Stream URL Parameter: ECL. Valid values are: 0 (L), 1 (M), 2 (Q), 3 (H).
- QRCodeErrorCorrectionLevel.L (0)
- QRCodeErrorCorrectionLevel.M (1)
- QRCodeErrorCorrectionLevel.Q (2)
- QRCodeErrorCorrectionLevel.H (3)
- QR Code can be divided into multiple data areas. Conversely, information stored in multiple QR Code symbols can be reconstructed as single data symbols.One data symbol can be divided into up to 16 symbols.
- Set EnableStructuredAppend property to true, then Structured Append is enabled.
About Structure Append Web Stream URL Parameter: EnableStructuredAppend. Valid values are: "true", or "false". - Set StructuredAppendCount property to the number of total symbols which make the sequence.
Web Stream URL Parameter: StructuredAppendCount. - Set StructuredAppendIndex property to the position of current symbol in the secuence (Start with 1).
Web Stream URL Parameter: StructuredAppendIndex.
- Set StructuredAppendParity property to a random unique integer. All QR Codes to store the same data message should have the same
StructuredAppendParity value.
Web Stream URL Parameter: StructuredAppendIndex.
- Set the FNC1Mode property.
Set value to FNC1Mode.FirstPosition to generate GS1 QR Code.
Web Stream URL Parameter: FNC1Mode. Valid values are: 0 (NotSupported), 1 (FirstPosition), 2 (SecondPostion).
- QRCodeFNC1Mode.NotSupported (0)
- QRCodeFNC1Mode.FirstPosition (1)
- QRCodeFNC1Mode.SecondPostion (2)
- Set the ApplicationIndicator property. Please set this property, if property FNC1Mode value is QRCodeFNC1Mode.SecondPostion (2).
Web Stream URL Parameter: AI. - Set the ECI property. The type is int. Valid values are from 000000 to 999999. About Extended Channel Interpretations
Web Stream URL Parameter: ECI.
QR Code Colors and Image Settings
- Set Color Related properties.
- Set the BackgroundColor property. Barcode background color can be changed.
Type is System.Drawing.Color. Default is BackgroundColor = Color.White. Web Stream URL Parameter: BackgroundColor.
- Set the ModuleColor property. Barcode bars color can be changed.
Type is System.Drawing.Color.Default is ModuleColor = Color.Black. Web Stream URL Parameter: ModuleColor.
- Set the ApplyCMYK property to
true. If the printed QR Code image format is EPS, you can enable this property to
true to use CMYK color mode in the EPS vector image file.
The default value is false.
-
Property ResizeImagePaddingTransparent. Default is
true.
If this property is true, then any padding area around the QR Code will be transparent. Otherwise, the padding area will have the same color as the BackgroundColor.
- Set QR Code with Logo image properties.
-
Property LogoImage. A
Bitmap object containing QR Code logo image data.
-
Property LogoRenderSize. Type is
SizeF. Specify the logo image dimension size in the center of the QR Code.
-
Property RemoveModulesUnderLogoImage. Default is false.
Set RemoveModulesUnderLogoImage to true, and all QR Code bar modules that are partially covered by the logo image will be converted to space modules.
- Set the ImageFormat property for barcode image format. The QR Code library supports QR Code output to raster and vector image formats.
Type is BLImageFormat. Default value is BLImageFormat.PNG. Web Stream URL Parameter: ImageFormat. Valid values are: gif, jpg, png, bmp, tif, svg, eps.
public enum BLImageFormat
{
PNG = 1,
JPG = 2,
BMP = 3,
GIF = 4,
TIF = 5,
EPS = 10,
SVG = 20
}
QR Code Exception and Error Handling Mode
-
Property IsThrowException. Default is
false.
When the QR Code generator library cannot create a QR Code successfully, the SDK will either generate an image with Invalid Barcode Settings text message printed, or through Exception in the .NET program.
.NET QR Code Basic Characteristics
QR Code is a matrix symbology with the following characteristics:
- Formats: QR Code, with full range of capabilities and maximum data capacity;
- Encodable character set:
- numeric data (digits 0 - 9);
- alphanumeric data (digits 0 - 9; upper case letters A -Z; nine other characters: space, $ % * + - . / : );
- byte data (default: ISO/IEC 8859-1);
- Kanji characters.
- Version (Symbol size) (not including quiet zone): 21 x 21 modules to 177 x 177 modules (Versions 1 to 40, increasing in steps of four modules per side).
- Maximum QR Code symbol size, Version 40-L:
- numeric data: 7089 characters
- alphanumeric data: 4296 characters
- Byte data: 2953 characters
- Kanji data: 1817 characters
- Selectable error correction level:
Four levels of Reed-Solomon error correction (referred to as L, M, Q and H in increasing order of capacity) allowing recovery of:
- L 7% of the symbol codewords
- M 15% of the symbol codewords
- Q 25% of the symbol codewords
- H 30% of the symbol codewords
- Structured Append: This allows files of data to be represented logically and continuously in up to 16 QR Code symbols.These may be scanned in any sequence to enable the original data to be correctly reconstructed.
- Extended Channel Interpretations: This mechanism enables data using character sets other than the default encodable set (e.g. Arabic,Cyrillic, Greek) and other data interpretations (e.g. compacted data using defined compression schemes)or other industry-specific requirements to be encoded.
- FNC1 Mode: FNC1 mode is used for messages containing specific data formats. In the "1st position" it designates data formatted in accordance with the GS1 General Specifications. In the "2nd position" it designates data formatted in accordance with a specific industry application previously agreed with AIM Inc. FNC1 mode applies to the entire symbol and is not affected by subsequent mode indicators.
How to Generate QR Code Barcode Image in .NET/C#/VB.NET class?
- Add Reference BarcodeLib.Barcode.ASP.NET.dll or BarcodeLib.Barcode.WinFroms.dll to your .NET project (ASP.NET website, Forms, any .NET project).
In your .NET class:
BarcodeLib.Barcode.QRCode barcode = new BarcodeLib.Barcode.QRCode(); barcode.Data = "123456789012";
barcode.ModuleSize = 3; barcode.LeftMargin = 0; barcode.RightMargin = 0; barcode.TopMargin = 0; barcode.BottomMargin = 0;
barcode.Encoding = BarcodeLib.Barcode.QRCodeEncoding.Auto; barcode.Version = BarcodeLib.Barcode.QRCodeVersion.V1; barcode.ECL = BarcodeLib.Barcode.QRCodeErrorCorrectionLevel.L; barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Png;
// more barcode settings here
// save barcode image into your system barcode.drawBarcode("c://barcode.png"); // generate barcode & output to byte array byte[] barcodeInBytes = barcode.drawBarcodeAsBytes(); // generate barcode to Graphics object Graphics graphics = ...; barcode.drawBarcode(graphics); // generate barcode and output to HttpResponse object HttpResponse response = ...; barcode.drawBarcode(response); // generate barcode and output to Stream object Stream stream = ...; barcode.drawBarcode(stream);
.NET Barcode Tutorial & FAQ
Provides High Quality .NET Barcode, Barcode .NET WinForms, C# Barcode, ASP.NET Barcode, VB.NET Barcode, .NET QR Code, ASP.NET QR Code, .NET WinForms QR Code, C# QR Code, VB.NET QR Code, .NET SSRS QR Code, .NET Crystal Reports QR Code, .NET RDLC Reports QR Code.
| |