Display OpenNetCf Signature control output on a desktop PC

Posted on 2007-10-19
Last Modified: 2013-12-21
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(myByteArray)
 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,
Question by:bean_ian
    LVL 48

    Expert Comment


    Author Comment

    Thanks Mikal but the problem is not displaying the signature on the pocket pc but rather on a standard desktop. I want to show the signature on a desktop pc running the 1.1 framework.
    Has anyone successfully done this using this particular control?

    Accepted Solution

    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.PaintEventArgs, ByVal sigIn() As Byte)
            'This method takes an open net cf signature and reconstructs it into a label'

                ' DrawSignature(e.Graphics)
                Dim g As Graphics
                ' background
                g = e.Graphics

                ' 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
            Catch ex As Exception
            End Try
        End Sub
    LVL 1

    Expert Comment

    Closed, 500 points refunded.
    EE Admin

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
    A short article about problems I had with the new location API and permissions in Marshmallow
    In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now