Lazarus
Announcements => Third party => Topic started by: Xor-el on October 13, 2018, 12:10:25 am
-
QRCodeGenLib4Pascal
Generates QR Codes from text strings and byte arrays.
QRCodeGenLib4Pascal is a PurePascal Delphi/FPC compatible library that provides an easy to use interface for generating QR Codes.
Features
Core features:
Supports encoding all 40 versions (sizes) and all 4 error correction levels, as per the QR Code Model 2 standard
Output formats: Raw modules/pixels of the QR symbol, SVG XML string/file, ImageObject(bmp, jpg and png).
Encodes numeric and special-alphanumeric text in less space than general text
Ability to change the backgound and foreground colors of the generated QRCode.
Manual parameters:
User can specify minimum and maximum version numbers allowed, then library will automatically choose smallest version in the range that fits the data
User can specify mask pattern manually, otherwise library will automatically evaluate all 8 masks and select the optimal one
User can specify absolute error correction level, or allow the library to boost it if it doesn't increase the version number
User can create a list of data segments manually and add ECI segments
Demos
Check out the QRCodeGenLib.Demo folder.
Link:
https://github.com/Xor-el/QRCodeGenLib4Pascal (https://github.com/Xor-el/QRCodeGenLib4Pascal)
-
Page added: http://wiki.freepascal.org/QRCodeGenLib4Pascal
-
Does the library depend on an online connection (where a server generates the QR code) or is it self-contained and able to provide offline functionality?
-
Does the library depend on an online connection (where a server generates the QR code) or is it self-contained and able to provide offline functionality?
Nope, it's self contained.
Does not require internet connection.
-
@Alextp, thanks a lot for the wiki page. :)
-
If possible please add to ONLINE PACKAGE MANAGER
-
If possible please add to ONLINE PACKAGE MANAGER
added to Online Package Manager.
-
Thanks
Now all user of Lazarus Can see that library
-
@Xor-el
Very very nice code -again - indeed! compliments.
-
@Xor-el
Very very nice code -again - indeed! compliments.
thanks for the nice compliments Thaddy. :)
-
just released v1.4 of this library.
* compatibility fix for raspberry pi in FPC
Now QRCodeGenLib4Pascal works beautifully in Raspberry PI via FPC. :)
-
Can we embed a custom logo in generated QR code with this lib?
-
Can we embed a custom logo in generated QR code with this lib?
While I did start working on something like this sometime ago, I stopped because I had to consider various edge cases and prevent the user from shooting him/her self in the foot.
Some of those cases are
1. The logo to be embedded should be a perfect square to able to calculate the offsets from the centre of the parent bitmap to the edges of the parent bitmap.
2. If am to resize the logo to meet the requirements, then I would need a way to resize images with transparent backgrounds without the issue of a black background after resizing.
but not to lose hope, you can draw your logo on the output bitmap after it is created, just remember to set the error correction level of the qrcode to at least medium or high.