Share My Creation [B4X] [XUI] QR Code with logo

QR Code with Logo
Designer Layout
B4J support


Version: 1.10
Supported Platforms: B4A, B4J
GitHub: https://github.com/pyhoon/qrcode-with-logo-b4a

I think this is my first time creating XUI custom view library.
Here is the first version based on QRGenerator.
As usual, welcome everyone to contribute to this open source project.

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    QRLogo.ShowLogo = True ' Show or hide
    QRLogo.LogoAlpha = 210 ' Logo alpha value
    QRLogo.SelectedLogo = QRLogo.OCTOCAT ' 4 logos (Constant variable) for selection
    QRLogo.CustomLogo = xui.LoadBitmapResize(File.DirAssets, "duck.png", 200dip, 200dip, True) ' Custom logo in your project
    QRLogo.Create("https://github.com/pyhoon/qrcode-with-logo-b4a") ' Pass a text to generate the QR code
End Sub
 

Attachments

  • QRCodeLogo.b4xlib
    19.7 KB · Views: 6
  • project.zip
    18.7 KB · Views: 4
Last edited:

aeric

Expert
Licensed User
Longtime User
This can be a good example on how to create a custom view library in b4xlib format.
Note:
Logo Alpha is set with Min and Max values.
CustomLogo can overrides SelectedLogo and vice-versa.

I just created a quick example and it is not well tested.
Not sure about resizing or padding. Maybe someone can improve it.
 

Theera

Well-Known Member
Licensed User
Longtime User
Thank you for your sharing. I have understand more than the past.:):):):):)
 
Top