Android Question Question about the B4XSignatureTemplate

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all.

I have a question.

I know that we can add a date and time to the signature SignatureTemplate.AddDateAndTime. But what if need to add some comments, like a full name of the person or any other text? Is it possible?

Thanks
 

TILogistic

Expert
Licensed User
Longtime User
?I wanted to add more features.

B4X:
    'Set optional title before capturing the image.
        B4XSignature1.Title($"Signature: $DateTime{DateTime.Now}"$, xui.Color_Black, 20, True)
        
        'Test resize and base64 the image.
        Dim Base64 As String : Dim SU As StringUtils
        
        'Resize the length base64 to save.
        'For save in datbase column type text, varchar or blob.
        Base64 = SU.EncodeBase64(ImageToBytes(B4XSignature1.Bitmap.Resize(350, 350, True)))
        
        'Convert Base64 to Image
        ImageView1.SetImage(BytesToImage(SU.DecodeBase64(Base64)))

        'See Size and text the base64.
        Log($"Base64 Text: ${Base64}"$)
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
?I wanted to add more features.

B4X:
    'Set optional title before capturing the image.
        B4XSignature1.Title($"Signature: $DateTime{DateTime.Now}"$, xui.Color_Black, 20, True)
       
        'Test resize and base64 the image.
        Dim Base64 As String : Dim SU As StringUtils
       
        'Resize the length base64 to save.
        'For save in datbase column type text, varchar or blob.
        Base64 = SU.EncodeBase64(ImageToBytes(B4XSignature1.Bitmap.Resize(350, 350, True)))
       
        'Convert Base64 to Image
        ImageView1.SetImage(BytesToImage(SU.DecodeBase64(Base64)))

        'See Size and text the base64.
        Log($"Base64 Text: ${Base64}"$)
Thank you for your reply but I need it for B4A and V4i.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Note: The class published in the post is version 1.0; later versions added more features, such as undo, redo, move, cut, etc.

B4A


B4J

I will soon publish the full version with the b4xlib library and examples.

In the new versions, signature smoothing algorithms were added to make it as realistic as possible.

Ref:
Algorithms:
DEMO WebView:
 
Last edited:
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Thanks to @William Lancee , who was the inspiration for researching curve smoothing and other topics.
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
And for decoding and encoding the image of the signatures, a class in B4X, without dependence on external libraries.
 
Upvote 0
Top