QRCode Component — sgcHTML | eSeGeCe

QRCode

TsgcHTMLComponent_QRCode — render a pure-Pascal ISO/IEC 18004 SVG QR code from any text or URL, with selectable error correction level, in Delphi, C++ Builder and .NET.

TsgcHTMLComponent_QRCode

Set Data and ECCLevel, then read the HTML property — or call the Build one-liner for a single line of code.

Component class

TsgcHTMLComponent_QRCode

Renders

Inline SVG QR code + optional caption (pure-Pascal encoder)

Languages

Delphi, C++ Builder, .NET

Set the payload, render it

Set Data, pick an ECCLevel, then read HTML — or call the static Build helper.

uses
  sgcHTML_Component_QRCode;

var
  oQR: TsgcHTMLComponent_QRCode;
  sHTML: string;
begin
  oQR := TsgcHTMLComponent_QRCode.Create(nil);
  try
    oQR.Data := 'https://www.esegece.com';
    oQR.ECCLevel := qrHigh;
    oQR.ModuleSize := 6;
    oQR.Caption := 'Scan to open';
    oQR.CaptionVisible := True;

    WebModule.Response := oQR.HTML;   // SVG QR modules + optional caption
  finally
    oQR.Free;
  end;
end;

// One-liner for inline use inside a bigger page:
sHTML := TsgcHTMLComponent_QRCode.Build('https://www.esegece.com', qrHigh, 6);
// includes: sgcHTML_Component_QRCode.hpp

TsgcHTMLComponent_QRCode *oQR = new TsgcHTMLComponent_QRCode(NULL);
try
{
  oQR->Data = "https://www.esegece.com";
  oQR->ECCLevel = qrHigh;
  oQR->ModuleSize = 6;
  oQR->Caption = "Scan to open";
  oQR->CaptionVisible = true;

  String html = oQR->HTML;   // SVG QR modules + optional caption
}
__finally
{
  delete oQR;
}
using esegece.sgcWebSockets;

var qr = new TsgcHTMLComponent_QRCode();
qr.Data = "https://www.esegece.com";
qr.ECCLevel = TsgcHTMLQRECCLevel.qrHigh;
qr.ModuleSize = 6;
qr.Caption = "Scan to open";
qr.CaptionVisible = true;

string html = qr.HTML;   // SVG QR modules + optional caption

Key properties & methods

The members you reach for most often.

Payload

Data holds the text or URL to encode; the encoder auto-selects numeric, alphanumeric or byte mode and the smallest version 1–40 that fits.

Error correction

ECCLevel (qrLow/qrMedium/qrQuartile/qrHigh) trades symbol size for damage tolerance.

Module size & quiet zone

ModuleSize sets the pixel size of each module; QuietZone controls the light border, in modules.

Colours

DarkColor/LightColor recolour the modules and background; keep enough contrast to stay scannable.

Caption

Caption/CaptionVisible render an optional text line below the code.

One-liner

The class function Build(aData, aECCLevel, aModuleSize) returns ready HTML without managing an instance.

Keep exploring

Online HelpFull API reference and usage guide for this component.
All sgcHTML ComponentsBrowse the full feature matrix of 80+ components.
Download Free TrialThe 30-day trial ships the 60.HTML demo projects.
PricingSingle, Team and Site licenses with full source code.

Ready to Get Started?

Download the free trial and start building web UIs in Delphi, C++ Builder and .NET.