KA.Barcode Generator for .NET Suite
How to Create & Resize QR Code in C#
Complete C#.NET source code to generate PDF-417 images and change barcode size with .NET Control

QR Code Generator C# library dll: how to create QR Code with free c# example source code

  • Full integration into Microsoft .NET Framework 2.0, 3.0, 3.5 and above versions
  • Print, draw matrix QR Code images in Windows Forms, display in ASP.NET web sites, Crystal Reports, C#.NET class
  • Creating, generating high-quality QR Code in Png, Jpeg, Gif, Tiff or Bmp image formats in .NET
  • Encode QR Code matrix bar codes and adjust the generated barcode quiet zones/ margins in C#
  • Support customizing the image width and height dimensions for Quick Response Code barcodes
  • Draw ITF-14 Word, .NET EAN 128, PDF417 Java, .NET PDF417 & other EAN 128 Excel in .NET IDEs
  • Generate, print QR Codes in Pixel, Cm, Inch as units of measure in C#.NET programming
  • Programmatically drawing, creating QR Code bar codes ranging from Versions 1 to 40
  • VB.NET PDF417, ISBN Java, VB.NET EAN 128, UPC-A .NET WinForms and other linear & 2D barcode control provided
  • Compatible with ISO/IEC specifications for QR Codes for scannable image output in C#.NET
QR Code is also named as Denso Barcode, QRCode, Quick Response Code, JIS X0510, ISO/IE18004. With KA.Barcode Generator for .NET Suite installed, developers can easily integrate, implement QR Code generating & barcoding in .NET projects like WinForms, ASP.NET web applications, Crystal Reports, C#.NET class and console applications. For more C# samples of QR Code generation, please check the links below:
Install KA.Barcode Generator for .NET Suite into C#.NET Project
  1. 1.
  2. 2.
    Add Reference: Add "KeepAutomation.Barcode.Window.dll" to your C#.NET project reference.
How to Generate, Resize QR Code Images in C# Class
Copy the following C#.NET sample codings onto your project to create, produce a QR Code barcode image
using KeepAutomation.Barcode.Bean;

BarCode qrcode = new BarCode();
qrcode.Symbology = KeepAutomation.Barcode.Symbology.QRCode;
qrcode.CodeToEncode = "C#qrdemo";
qrcode.X = 3;
qrcode.Y = 3;

QR Code Barcode Unit

Before adjusting QR Code image size, you should know that since the default value for barcode unit is Pixel, all the QR Code properties are measured in this unit of measure. If you want to change it into Cm or Inch, just follow the demo code below.
qrcode.BarcodeUnit = BarcodeUnit.Pixel;

QR Code X and Y Dimension (Module Width and Module Height)

X dimension is the width of the module bar in a QR Code barcode image. This value type is float with 1 pixel as default value in KeepAutomation .NET QR Code Barcode. Y is the height of the module bar. Users need to set X and Y to the same value.
qrcode.X = 3;         
qrcode.Y = 3;

QR Code Version

Size for a QR Code I represented in terms of position in the sequence of permissible sizes for QR Code versions, valid from Version 1 (21 x 21 modules) to Version 40 (177 x 177 modules). Default value is Version 1. You can adjust this parameter through the C# demo code below.
qrcode. QRCodeVersion = QRCodeVersion .V1;

QR Code Margins / Quiet Zones

Quiet zone is the white margins surrounding the symbol on all four sides, which shall be free of all other markings. As required in the ISO/IEC 18004 QR Code specification, the width of the quiet zone shall be 4X. If you set X to be 3, then you should set margin as below:
qrcode.TopMargin = 12;
qrcode.BottomMargin = 12;
qrcode.LeftMargin = 12;
qrcode.RightMargin = 12;

QR Code BarCode Height and BarCode Width

With C#.NET QR Code Generator, users can also customize QR Code BarCodeHeight (Float; Default: 0) and BarCodeWidth (Float; Default: 0) for the generated QR Code bar code image. Here is the demo code in C#.
qrcode.BarCodeHeight = 70;
qrcode.BarCodeWidth = 175;
Please note that once you have adjusted QR Code X dimension and symbol version, the QR Code size is already fixed. If the barcode width you set is greater, extra margins are added for the generated QR Code image. But if the barcode width you set is less, KA.Barcode Generator will automatically create a valid QR Code image according to your X and version value.