cQRcode QR Code Component Overview
Introduction
cQRcode is a QR code generation component based on Nayuki's QR Code Generator Library (MIT License). Supports generating standard QR code images with customizable content, size, and colors.
Features
| Feature | Description |
|---|---|
| Pure VB Implementation | No external dependencies |
| Chainable API | Fluent API design |
| Error Correction Levels | Supports L/M/Q/H four-level error correction |
| Auto Encoding | Supports numeric, alphanumeric, byte multiple modes |
| Clipboard Output | Supports direct copy to clipboard |
| Image Return | Returns StdPicture object, can display directly |
Error Correction Levels
| Level | Constant | Error Tolerance | Use Case |
|---|---|---|---|
| L | QRCodegenEcc_LOW | ~7% | Clean environment |
| M | QRCodegenEcc_MEDIUM | ~15% | General scenarios |
| Q | QRCodegenEcc_QUARTILE | ~25% | Some damage |
| H | QRCodegenEcc_HIGH | ~30% | Severe damage |
Quick Start
Basic Usage
vb
Dim QR As New cQRcode
' Simple generation
Set Image1.Picture = QR.Generate()Chainable Settings
vb
Dim QR As New cQRcode
' Chainable call to set properties and generate
Set Image1.Picture = QR _
.SetText("https://www.vb6.pro") _
.SetSize(200) _
.SetForeColor(vbBlue) _
.Generate()Copy to Clipboard
vb
Dim QR As New cQRcode
' Generate and copy to clipboard
QR.SetText("Hello World").Generate True
' Now can paste to other applicationsSave as Image File
vb
Dim QR As New cQRcode
' Generate and save
Set QR.Picture = QR.SetText("Save me!").Generate()
SavePicture QR.Picture, App.Path & "\qrcode.bmp"File Structure
| File | Description |
|---|---|
cQRcode.cls | QR code class with simple interface |
mQRcodeGen.bas | Core generation algorithm module |
Low-level Functions (Advanced Usage)
For more fine-grained control, you can directly use module functions:
vb
' Directly use low-level functions
Set Picture1.Picture = QRCodegenBarcode( _
TextOrByteArray:="Hello", _
clrFore:=vbBlack, _
Ecl:=QRCodegenEcc_MEDIUM, _
MinVersion:=1, _
MaxVersion:=5, _
Mask:=QRCodegenMask_AUTO, _
BoostEcl:=True, _
PicSize:=300 _
)Last Updated: 2026-05-17