Page 1 of 1

[Module] QRCode (all OS)

Posted: Fri May 20, 2022 5:46 pm
by Thorsten1867
QRCode - Module (all OS / 64Bit / DPI)

( Based on the code of infratec )
  • QRCode - Gadget
  • Create a QR-Code (Image)
  • Decode QR-Code (image)

Code: Select all

; ----- Image -----
; QRCode::Create()             - Create an image with the QRCode
; QRCode::SetDefaults()        - Change defaults for Create()

; ----- Gadget -----
; QRCode::Gadget()             - Gadget for QRCodes

; QRCode::GetText()            - similar to 'GetGadgetText()'
; QRCode::GetColor()           - similar to 'GetGadgetColor()'

; QRCode::SetAutoResizeFlags() - [#MoveX|#MoveY|#Width|#Height]

; QRCode::SetAttribute()       - similar to 'SetGadgetAttribute()'
; QRCode::SetColor()           - similar to 'SetGadgetColor()'
; QRCode::SetText()            - similar to 'SetGadgetText()'

; ----- Decode -----
; QRCode::Decode()              - decodes an image with QRCode
Download 'QRCodeModule.pbi'

Re: [Module] QRCode Gadget (all OS)

Posted: Sat May 21, 2022 12:17 pm
by Thorsten1867
Update: Deocoding of QR-Codes added

Re: [Module] QRCode Gadget (all OS)

Posted: Sat May 21, 2022 2:05 pm
by STARGÅTE
You forgot the code or a download link.

Re: [Module] QRCode Gadget (all OS)

Posted: Sat May 21, 2022 2:09 pm
by Thorsten1867
Look in my signature

Re: [Module] QRCode Gadget (all OS)

Posted: Sat May 21, 2022 2:42 pm
by STARGÅTE
Thorsten1867 wrote: Sat May 21, 2022 2:09 pm Look in my signature
Thanks for adding the direct link.
Signatures can be hidden in the forum theme, and some people actually hide them to improve the readability of topics.

Re: [Module] QRCode (all OS)

Posted: Tue Oct 25, 2022 2:07 am
by Paul
Just a note, there is a bug in this Module where if you set the frontcolor using

Code: Select all

QRCode::SetColor(#Gadget, QRCode::#FrontColor, $800000)
but do not set any text using

Code: Select all

QRCode::SetText(#Gadget, "Hello World")
it will cause a crash.


An easy fix is to edit the Procedure Draw_()
and add a check at the end of the procedure by changing

Code: Select all

DrawImage(ImageID(QRCode()\Image), X, Y)
to

Code: Select all

If IsImage(QRCode()\Image)
   DrawImage(ImageID(QRCode()\Image), X, Y)
EndIf

Re: [Module] QRCode (all OS)

Posted: Tue Oct 25, 2022 3:48 am
by idle
Nice module thankyou.

Re: [Module] QRCode (all OS)

Posted: Tue Mar 21, 2023 12:29 pm
by Thorsten1867
Paul wrote: Tue Oct 25, 2022 2:07 am Just a note, there is a bug in this Module where if you set the frontcolor using

Code: Select all

QRCode::SetColor(#Gadget, QRCode::#FrontColor, $800000)
but do not set any text using

Code: Select all

QRCode::SetText(#Gadget, "Hello World")
it will cause a crash.


An easy fix is to edit the Procedure Draw_()
and add a check at the end of the procedure by changing

Code: Select all

DrawImage(ImageID(QRCode()\Image), X, Y)
to

Code: Select all

If IsImage(QRCode()\Image)
   DrawImage(ImageID(QRCode()\Image), X, Y)
EndIf
Bug fixed.

Re: [Module] QRCode (all OS)

Posted: Wed Jan 29, 2025 4:24 pm
by Psychophanta
It looks like read a qr image good, and the numeric code is correct.
The problem is that when try the conversion again to the graphic from the numerical code, then the result is far to be correct.