Skip to content

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 ​

FeatureDescription
Pure VB ImplementationNo external dependencies
Chainable APIFluent API design
Error Correction LevelsSupports L/M/Q/H four-level error correction
Auto EncodingSupports numeric, alphanumeric, byte multiple modes
Clipboard OutputSupports direct copy to clipboard
Image ReturnReturns StdPicture object, can display directly

Error Correction Levels ​

LevelConstantError ToleranceUse Case
LQRCodegenEcc_LOW~7%Clean environment
MQRCodegenEcc_MEDIUM~15%General scenarios
QQRCodegenEcc_QUARTILE~25%Some damage
HQRCodegenEcc_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 applications

Save 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 ​

FileDescription
cQRcode.clsQR code class with simple interface
mQRcodeGen.basCore 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

VB6 and LOGO copyright of Microsoft Corporation