Lazarus

Announcements => Third party => Topic started by: Xor-el on October 13, 2018, 12:10:25 am

Title: QRCodeGenLib4Pascal
Post 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)
Title: Re: QRCodeGenLib4Pascal
Post by: AlexTP on October 13, 2018, 07:44:41 am
Page added: http://wiki.freepascal.org/QRCodeGenLib4Pascal
Title: Re: QRCodeGenLib4Pascal
Post by: jwdietrich on October 13, 2018, 08:31:42 am
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?
Title: Re: QRCodeGenLib4Pascal
Post by: Xor-el on October 13, 2018, 08:47:27 am
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.
Title: Re: QRCodeGenLib4Pascal
Post by: Xor-el on October 13, 2018, 09:35:29 am
@Alextp, thanks a lot for the wiki page. :)
Title: Re: QRCodeGenLib4Pascal
Post by: heejit on October 13, 2018, 10:34:48 am
If possible please add to ONLINE PACKAGE MANAGER

Title: Re: QRCodeGenLib4Pascal
Post by: Xor-el on October 16, 2018, 12:05:28 pm
If possible please add to ONLINE PACKAGE MANAGER

added to Online Package Manager.
Title: Re: QRCodeGenLib4Pascal
Post by: heejit on October 16, 2018, 12:38:50 pm
Thanks

Now all user of Lazarus Can see that library
Title: Re: QRCodeGenLib4Pascal
Post by: Thaddy on October 16, 2018, 02:27:33 pm
@Xor-el
Very very nice code -again - indeed! compliments.
Title: Re: QRCodeGenLib4Pascal
Post by: Xor-el on December 27, 2018, 08:02:36 am
@Xor-el
Very very nice code -again - indeed! compliments.

thanks for the nice compliments Thaddy.  :)
Title: Re: QRCodeGenLib4Pascal
Post by: Xor-el on December 27, 2018, 08:08:44 am
just released v1.4 of this library.

* compatibility fix for raspberry pi in FPC

Now QRCodeGenLib4Pascal works beautifully in Raspberry PI via FPC.  :)
Title: Re: QRCodeGenLib4Pascal
Post by: avra on December 27, 2018, 09:25:54 am
Can we embed a custom logo in generated QR code with this lib?
Title: Re: QRCodeGenLib4Pascal
Post by: Xor-el on December 27, 2018, 10:35:40 am
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.
TinyPortal © 2005-2018