Microsoft
Software
Hardware
Network
Question : Display OpenNetCf Signature control output on a desktop PC
Hi,
I have a Windows CE4.2 application which uses the OpenNetCF Library of controls, one of which is the signature control. When a user enters their signature and saves it I put the signature into a byte array using the 'GetSignatureEx' method and store it in an Image datatype in Sql Server 2000. This works fine and im able to save and view signatures using the Signature control, however I have a requirement to view the Signature from a standard Desktop application (full 1.1 framework). When i read in the byte array to a memory stream and use the FromStream method to create an Image I get an Invalid Parameter error.
Heres the code giving me grief:
Dim mem As New IO.MemoryStream(myByteArra
y)
mem.Write(myByteArray, 0, myByteArray)
lblSigned.Image = Image.FromStream(mem)
Does anyone have much experience using the openNetCf Signature control?
I suspect its something to do with the way the control stores the image is the byteArray when it is first saved.
Thanks for your help,
Ian
Answer : Display OpenNetCf Signature control output on a desktop PC
i have since found out that the OpenNetCf signature control store an array of line points rather than the bitmap in the database. here is code i wrote that reconstructs these line points into an image.
Private Sub reconstructSignature(ByVal
e As System.Windows.Forms.Paint
EventArgs,
ByVal sigIn() As Byte)
'This method takes an open net cf signature and reconstructs it into a label'
Try
' DrawSignature(e.Graphics)
Dim g As Graphics
' background
g = e.Graphics
g.Clear(Color.Cornsilk)
' border
g.DrawRectangle(Pens.Black
, 0, 0, 232, 64)
g.SmoothingMode = SmoothingMode.AntiAlias
Dim line As New Point
Dim i As Int32
For i = 0 To sigIn.Length - 4 Step 2
If sigIn(i) <> 0 And sigIn(i + 1) <> 0 And sigIn(i + 2) <> 0 And sigIn(i + 3) <> 0 Then
g.DrawLine(Pens.Black, sigIn(i), sigIn(i + 1), sigIn(i + 2), sigIn(i + 3))
End If
Next
Catch ex As Exception
FormManager.showError(ex)
End Try
End Sub
Random Solutions
Server 2003, Backup Exec 10d crashes during backup.
Using E4X to Parse XML data
doubt in FTP comment
After Effects, creating a loop
Backup SBS 2003 Exchange
Timer Interval not working
Linux init script, bash, exporting variable and accessing as another user?
Difference between pop3 and imap
delete a record using VBA.
New Server 2003 RS installation - no network