I have set up a layout within a ScrollView with panels working as signature boxes.
The problem I have is that the scrollview wiggles about as the signature is being read.
Currently, I have a signature being recorded via the following method:
Note: the following code was lifted from the Signature recording tutorial http://www.b4x.com/forum/basic4andr...utorials/9096-signature-capture-tutorial.html
The real major problem is that the ScrollView is interfering with the recording of the signature, causing vertical lines to be recorded, instead of the desired signature.
My hope is that the solution will involve locking the scrolling of the ScrollView while the signature panel is being touched, because on top of the interference, the wiggling of the form is unsightly.
How should I approach this problem?
Kind regards,
Nick
The problem I have is that the scrollview wiggles about as the signature is being read.
Currently, I have a signature being recorded via the following method:
Note: the following code was lifted from the Signature recording tutorial http://www.b4x.com/forum/basic4andr...utorials/9096-signature-capture-tutorial.html
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Type SignatureData (Canvas As Canvas, Panel As Panel, SignatureColor As Int, SignatureWidth As Int)
Dim PreviousX, PreviousY As Int
Dim SignatureData as SignatureData
Dim Canvas as Canvas
Dim Panel as Panel : ' This view is part of the layout "innerformlayout" i.e. inside the ScrollView
Dim ScrContent as ScrollView : ' This view is part of the layout "outerformlayout" i.e. The container for the ScrollView
End Sub
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
Activity.LoadLayout("outerformlayout")
If ScrContent.IsInitialized Then
ScrContent.Panel.LoadLayout("innerformlayout")
Canvas.Initialize(Panel)
SignatureData.Initialize
SignatureData.Canvas = Canvas
SignatureData.Panel = Panel
SignatureData.SignatureColor = 0xFF002F8F
SignatureData.SignatureWidth = 2dip
End If
End Sub
B4X:
sub Panel_Touch(Action As Int, X As Float, Y As Float)
If Action = 0 Then 'A value of 0 in Action means that the mouse is pressed down
PreviousX = X
PreviousY = Y
Else
SignatureData.Canvas.DrawLine(PreviousX, PreviousY, X, Y, SignatureData.SignatureColor, SignatureData.SignatureWidth)
SignatureData.Panel.Invalidate
PreviousX = X
PreviousY = Y
End If
End Sub
The real major problem is that the ScrollView is interfering with the recording of the signature, causing vertical lines to be recorded, instead of the desired signature.
My hope is that the solution will involve locking the scrolling of the ScrollView while the signature panel is being touched, because on top of the interference, the wiggling of the form is unsightly.
How should I approach this problem?
Kind regards,
Nick
Last edited: