Android Question [SOLVED] Add text in Signature Template

manuel_g

Member
Licensed User
Hello!

I'm using this for signing and works perfect BUT I want to add a text to the sign (like the .AddDateAndTime)
B4X:
Sub Signature1Button_Click
    Dialog.ButtonsFont = XUI.CreateFontAwesome(20)
    
    'This doesn't work but it's what I'd want to do
    'SignatureTemplate.mBase.Text="Add this text"

    Dim rs As ResumableSub = Dialog.ShowTemplate(SignatureTemplate, Chr(0xF00C), "", Chr(0xF00D))
    
    Dialog.GetButton(XUI.DialogResponse_Positive).TextColor = XUI.Color_Green
    Dialog.GetButton(XUI.DialogResponse_Cancel).TextColor = XUI.Color_Red
    Dialog.ButtonsFont = XUI.CreateDefaultBoldFont(15) 'return it to the default font. It will no longer affect the current dialog
    
    Wait For (rs) Complete (Result As Int)
    If Result = XUI.DialogResponse_Positive Then
        SignatureImage1.SetBitmap(SignatureTemplate.Bitmap.Resize(SignatureImage1.Width, SignatureImage1.Height, True))
        Dim out As OutputStream = File.OpenOutput(WorkingPath, "signature1.png", False)
        SignatureTemplate.Bitmap.WriteToStream(out, 100, "PNG")
        out.Close
    End If
    
End Sub

Thank you
 

manuel_g

Member
Licensed User
Create your own template based on B4XSignatureTemplate. Unzip XUI Views.b4xlib. Fetch the file. Rename it to MySignatureTemplate.bas. Add it to your project and modify the code. The code is very simple.

You're right, it was very simple to modify! Thank you, as always!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…