Private Sub Button1_Click
Dialog.ButtonsFont = xui.CreateFontAwesome(20)
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
ImageView1.SetBitmap(SignatureTemplate.Bitmap.Resize(ImageView1.Width, ImageView1.Height, True))
Dim out As OutputStream
#IF B4A
out = File.OpenOutput(File.DirInternal, "signature.png", False) 'don't use File.DirApp in real applications
#ELSE IF B4J
out = File.OpenOutput(File.DirApp, "signature.png", False) 'don't use File.DirApp in real applications
#ELSE IF B4I
out = File.OpenOutput(File.DirDocuments, "signature.png", False)
#End If
SignatureTemplate.Bitmap.WriteToStream(out, 100, "PNG")
out.Close
End If
End Sub