Skip to content

p-samuel/qrcmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔲◼️qrcmd - QR Code (De)Generator (for Delphi)

Generate/Read QR codes for Delphi via simple minimalist API.

QR Code Demo

Features:

  • Versions 1-10 (~216 bytes)
  • Generate/Decode

Example:

qrcmd > WIFI:T:WPA;S:MyNetwork;P:Pass;;
qrcmd > save wifi.png
qrcmd > read wifi.png
Decoded: WIFI:T:WPA;S:MyNetwork;P:Pass;;

Code:

QR := TQRCode.Create;
try
  // Generate
  QR.Generate('Hello');
  QR.RenderToConsole;                   // Terminal
  QR.SaveToPng('qr.png');               // VCL
  Image1.Bitmap := QR.ToBitmap;         // FMX/VCL
  JView.setImageBitmap(QR.ToJBitmap);   // JNI

  // Read
  Writeln(QR.ReadFromPng('qr.png'));    // From file
  Writeln(QR.ReadFromBitmap(Bmp));      // From TBitmap
finally
  QR.Free;
end;

Tests

Compile and run tester(DUnix) under tests\bin\Win32. Should get simmilar results.

Fixture : Test
-------------------------------------------------
Fixture : Test.QRCode
-------------------------------------------------
Fixture : Test.QRCode.TQRCodeTests

Done testing.
Tests Found   : 90
Tests Ignored : 0
Tests Passed  : 90
Tests Leaked  : 0
Tests Failed  : 0
Tests Errored : 0

Obs. Test images are saved under local /temp from where the app runs. If you need change this. Seek for GetTempFileName in Test.QRCode.pas.