Sample code for 30+ languages & platforms
Delphi ActiveX Requires Chilkat v11.7.0+

Get the QR Code Capabilities of the Chilkat Version in Use

See more QR Code Examples

Demonstrates the capabilities operation, which describes what the installed version of Chilkat can do: the range of QR versions, the error-correction levels, the operations, the image formats and the limits. A program can check for a feature here instead of testing for a Chilkat version number. The request can be an empty JSON object.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
var
success: Integer;
json: TChilkatJsonObject;
fmt: TChilkatFormats;
jsonOut: TChilkatJsonObject;
i: Integer;
n: Integer;

begin
success := 0;

//  This example requires the Chilkat API to have been previously unlocked.
//  See Global Unlock Sample for sample code.

json := TChilkatJsonObject.Create(Self);
fmt := TChilkatFormats.Create(Self);
jsonOut := TChilkatJsonObject.Create(Self);
success := fmt.QrCode('capabilities',json.ControlInterface,jsonOut.ControlInterface);
if (success = 0) then
  begin
    Memo1.Lines.Add(fmt.LastErrorText);
    Exit;
  end;

Memo1.Lines.Add('Chilkat version: ' + jsonOut.StringOf('productVersion'));
Memo1.Lines.Add('symbology: ' + jsonOut.StringOf('symbologies[0].id'));
Memo1.Lines.Add('QR versions: ' + IntToStr(jsonOut.IntOf('symbologies[0].encoding.version.min')) + ' to ' + IntToStr(jsonOut.IntOf('symbologies[0].encoding.version.max')));
Memo1.Lines.Add('structured append, most symbols: ' + IntToStr(jsonOut.IntOf('symbologies[0].structuredAppend.maxSymbols')));

n := jsonOut.SizeOfArray('symbologies[0].encoding.errorCorrection');
for i := 0 to n - 1 do
  begin
    jsonOut.I := i;
    Memo1.Lines.Add('error correction: ' + jsonOut.StringOf('symbologies[0].encoding.errorCorrection[i]'));
  end;

//  The operations this version implements.
n := jsonOut.SizeOfArray('operations');
for i := 0 to n - 1 do
  begin
    jsonOut.I := i;
    if (jsonOut.BoolOf('operations[i].available') = 1) then
      begin
        Memo1.Lines.Add('operation: ' + jsonOut.StringOf('operations[i].name'));
      end;
  end;

n := jsonOut.SizeOfArray('imageFormats.output');
for i := 0 to n - 1 do
  begin
    jsonOut.I := i;
    Memo1.Lines.Add('image format: ' + jsonOut.StringOf('imageFormats.output[i]'));
  end;

Memo1.Lines.Add('default timeout: ' + IntToStr(jsonOut.IntOf('limits.timeoutMs.default')) + ' ms');
Memo1.Lines.Add('default largest image: ' + IntToStr(jsonOut.IntOf('limits.maxPixels.default')) + ' pixels');

//  Sample output:

//  Chilkat version: 11.7.0
//  symbology: qr
//  QR versions: 1 to 40
//  structured append, most symbols: 16
//  error correction: auto
//  error correction: L
//  error correction: M
//  error correction: Q
//  error correction: H
//  operation: generate
//  operation: measure
//  operation: validate
//  operation: capabilities
//  image format: png
//  image format: svg
//  default timeout: 10000 ms
//  default largest image: 16777216 pixels