IvonaldoSilva-5124 avatar image
0 Votes"
IvonaldoSilva-5124 asked JiachenLiMFST-9349 edited

Digital Sign


I have to store contract signatures in a database. I'm using an example that I found here some time ago.

The question is, I can sign with the optical pen but I can't record the generated image. I have to generate a jpg and link that image to a picturebox. However, if the customer is not happy with the quality of the signature, I cannot repeat the process without first closing the screen and reopening it.

Is there a way after signing I can record in the bank without having to generate a jpg linked to a picturebox?

Below is the code I am using.
Thank you for everyone's attention and cooperation.

Dim myMs As New IO.MemoryStream
Dim xStart, yStart, xEnd, yEnd As Integer
Dim Drawbitmap As Bitmap
Dim DrawbitmapResp As Bitmap
Dim Drawgraphics As Graphics
Dim DrawgraphicsResp As Graphics
Dim myPen As New Pen(Color.BlueViolet, 3)
Dim myColor As Color = Color.Blue
Dim myBrush As New Drawing.SolidBrush(Color.Black)
Dim myBrushWidth As Integer
Dim ContinuousFlag As Boolean

Private Sub PreparaBox()
Drawbitmap = New Bitmap(PictFpd.Width, PictFpd.Height)
Drawgraphics = Graphics.FromImage(Drawbitmap)
PictFpd.Image = Drawbitmap
myBrushWidth = 4
End Sub
Private Sub drawMyline()
PictFpd.Image = Drawbitmap
Drawgraphics.SmoothingMode = Drawing2D.SmoothingMode.HighQuality
Drawgraphics.DrawLine(myPen, xStart, yStart, xEnd, yEnd)
End Sub

 Private Sub Pictfpd_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictFpd.MouseDown
     xStart = Control.MousePosition.X - (Me.Left + PictFpd.Left + 4)
     yStart = Control.MousePosition.Y - (Me.Top + PictFpd.Top + 31)

     If RadioButton1.Checked = True Then
         ContinuousFlag = True
     End If
 End Sub
 Private Sub Pictfpd_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictFpd.MouseMove
     If ContinuousFlag Then
         Drawgraphics.SmoothingMode = Drawing2D.SmoothingMode.None
         Drawgraphics.FillEllipse(myBrush, e.X, e.Y, myBrushWidth, myBrushWidth)
         PictFpd.Image = Drawbitmap
     End If
 End Sub
 Private Sub Pictfpd_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictFpd.MouseUp
     xEnd = Control.MousePosition.X - (Me.Left + PictFpd.Left + 4)
     yEnd = Control.MousePosition.Y - (Me.Top + PictFpd.Top + 31)

     If RadioButton1.Checked Then
         ContinuousFlag = False
     End If
 End Sub

Private Sub BotaoSalvar_Click(sender As Object, e As EventArgs) Handles BotaoSalvar.Click
If CodigoUsuario = 0 Then MsgE("Escolha o Usuário") : Exit Sub

     PictFpd.Image.Save("C:\temp\" & CodigoUsuario & ".jpg")
     PictFpd.Load("C:\temp\" & CodigoUsuario & ".jpg")
     With NovoSign
         If Not IsNothing(PictFpd.Image) Then
             PictFpd.Image.Save(myMs, PictFpd.Image.RawFormat)
             .PArrImage = myMs.ToArray
             .PCodCli = CodigoUsuario
             .PCodTipoCli = 3
             If .SalvarSign = False Then Exit Sub
         End If
     End With
 End Sub

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @IvonaldoSilva-5124 ,
I tried using the code you provided, but there are many undeclared variables in it, I don't know what they are.
Can you provide a sample project that does not contain private information via github or OneDrive for us to test?

0 Votes 0 ·

0 Answers