[Patch] TImageQRCodeGenerator improvements
Original Reporter info from Mantis: kluug.net @onpok
-
Reporter name: Ondrej Pokorny
Original Reporter info from Mantis: kluug.net @onpok
- Reporter name: Ondrej Pokorny
Description:
First of all thank you for the QR generator!
However I found the TImageQRCodeGenerator strange in some cases:
1.) Origin is a property. This is very uncommon. Usually Origin/Destination is a parameter in the Draw method (see e.g. in TFPCustomCanvas.Draw).
2.) Border is not a property but a parameter in SaveToFile method. This is the opposite case as (1). You may want to draw (= execute the Draw method) the QR object with a border and not to save it to a file. It's not possible with current implementation.
3.) There is no SaveToStream() to generate the image for in-memory use.
4.) There is no exception or any other way to determine that SaveToFile wasn't executed because of unsupported target image file. Try to use "qrcode.xyz" as target file in createqrcode demo.
5.) TCreateQRApplication.WriteQRCode is not used.
The attached patch fixes the above points and changes the demo and fcl-pdf.
Mantis conversion info:
- Mantis ID: 32580
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 37492 (#b5f9cce9)
- Target version: 3.2.0