--- In [email protected], "brianm...@..." <brianm...@...> wrote:
>
> Hi
>
> Can anyone help me get started with a signature capture box. I am told the
> picture box is the way to go but a few pointers would be greatly appreciated.
>
> Many thenks
>
> Brian
Hi Brian. Here's a few details about the way I did it.
- Dropped a picture box onto the form using the toolbox, named it PBox with the
properties window.
- Added the following code lines to the form_load:
PBox.FillColor = RGB(255, 255, 255)
PBox.CreateImage PBox.Width, PBox.Height
- Used the following code to handle the actual drawing:
Sub FreeHand(X,Y)
If curX <> -1 And curY <> -1 Then
pbox.drawline CurX,CurY,X,Y,colorBlack,0,0
End If
'TempXY=TempXY & "#" & X & "#" & Y
CurX=X
CurY=Y
End Sub
Sub pbox_mousedown(button, shift, X, Y)
CurX=X
CurY=Y
Call FreeHand(X, Y)
pbox.refresh
End Sub
Sub pbox_mouseup(button, shift, X, Y)
Call FreeHand(X, Y)
pbox.refresh
End Sub
Sub pbox_mousemove(button, shift, X, Y)
Call FreeHand(X, Y)
pbox.refresh
End Sub
- Added 'clear' and 'save' buttons below the picture box, with the following
code handlers:
Sub btnClearSig_Click
PBox.FillColor = RGB(255, 255, 255)
PBox.CreateImage PBox.Width, PBox.Height
End Sub
Sub btnSaveSig_Click
sigID = nextSigID
nextSigID = nextSigID + 1
Dim filename, filepath, result
filename = sigID & ".bmp"
filepath = "\My Documents\printouts\" & filename
result = PBox.SaveImageToFile(filepath, 0)
cn.Execute "insert into signatures values (" & sigID & ", '" & filename &
"')"
Dim sql
cn.Execute sql
frmPrint_show
frmSig_hide
End Sub
nextSigID is a self-incrementing primary key field, and cn is my open SQLite
object.
Hope that this helps you out.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nsb-ce" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nsb-ce?hl=en
-~----------~----~----~----~------~----~------~--~---