Android Question How does one change signature template pen color without erasing the drawing on signature template

IndieDev

Active Member
Licensed User
Hi,

Been trying to change the pen color for the B4XSignatureTemplate, like below.

B4XSignatureTemplate pen color change:
Sub Btn_Color_Click
    Wait For (Dialog.ShowTemplate(ColorTemplate, "OK", "", "CANCEL")) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        SignatureTemplate.StrokeColor = ColorTemplate.SelectedColor
        DrawPad        ' display the Signature template again
    End If
End Sub

Sub Btn_Erase_Click
    '???
End Sub

But the earlier drawing on Signature template disappears, since I'm reloading the template.
How do I do this?

Also, how do I erase the current drawing?
Can we do something like an "Eraser" effect?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Also, how do I erase the current drawing?
Can we do something like an "Eraser" effect?
There is no built-in erasing feature. You can take the color template source code, rename it and create your own template.

Been trying to change the pen color for the B4XSignatureTemplate, like below.
This cannot work as the lines were already drawn.
You can use BitmapColorEffects.ReplaceColor for this.
 
Upvote 0

IndieDev

Active Member
Licensed User
There is no built-in erasing feature. You can take the color template source code, rename it and create your own template.
OK. It will be a challenge for me.... ?
But I'll try....

This cannot work as the lines were already drawn.
You can use BitmapColorEffects.ReplaceColor for this.
Then I think I'll use 4 buttons to select the primary colors + black.
I had seen someone do similarly, somewhere in the forum....

At least, this way, the strokecolor can be changed immediately.

B4X:
SignatureTemplate.StrokeColor = Colors.Red
 
Upvote 0
Top