Signature Capture

A

Aaron

I've searched the web, the archives, everywhere, and can't seem to
find a bit of useful help. Here's what I need. I simply need to
capture a signature and save it as a bitmap. I will need to be
storing this bitmap in a .cdb file (yes I am using ADOCE InTheHand).
All the examples, including the Microsoft article that has signature
capture, are way out of my league and of no help whatsoever. My
client needs this app in three weeks and I fear I'll have to tell him
I just can't provide signature capture. I would look at Hood Canal's
website, but it does not exist. I'm using VB .NET

Thanks
 
A

Aaron

Wow, thanks Robbe, much simpler to understand for a newbie. So
basically, I can save this text directly in a text field in my .cdb
file, correct? I'll have more of a look at this and if any questions
pop up, I'll post them here in case others might find it helpful.
 
A

Aaron

I seem to be getting an exception everytime I try to load a saved
file. I could not get the C# class to work in my VB.NET project so I
used a converter and all went well, or so I think. My guess is
something went wrong in the conversion of either your Save or Load
function. The error I get when trying to load a saved file is:

NullReferenceException

If I try to just open up the text file manually ouside of my app, I
get the following error:

Due to the size of the file, an access error was encountered while
opening the file.

Here's the converted Save and Load functions for you to look at in
case they didn't turn out right when I converted using a utility app.

Public Sub Save(ByVal FileName As String)
Dim l As LineToDraw

Try
If Points.Count < 1 Then
Return
End If
Dim sw As New StreamWriter(FileName, False)

Dim i As Integer
For i = 0 To Points.Count - 1
l = CType(Points(i), LineToDraw)
sw.Write((l.StartX.ToString() + Delimiter))
sw.Write((l.StartY.ToString() + Delimiter))
sw.Write((l.EndX.ToString() + Delimiter))
sw.WriteLine(l.EndY.ToString())
Next i

sw.Close()

Catch
Throw
End Try
End Sub 'Save

Public Sub Load(ByVal FileName As String)
Dim l As LineToDraw

Try
Me.Clear(True)
Dim sr As New StreamReader(FileName)
Dim line As String

While Not (line = sr.ReadLine()) <> Nothing

l = New LineToDraw

Dim linesplit As String() =
line.Split(Delimiter.ToCharArray())

l.StartX = Integer.Parse(linesplit(0).ToString())
l.StartY = Integer.Parse(linesplit(1).ToString())
l.EndX = Integer.Parse(linesplit(2).ToString())
l.EndY = Integer.Parse(linesplit(3).ToString())
Points.Add(l)
End While

sr.Close()
Catch
Throw
End Try
End Sub 'Load

Thanks for any help.
 
A

Aaron

I seem to be getting an exception everytime I try to load a saved
file. I could not get the C# class to work in my VB.NET project so I
used a converter and all went well, or so I think. My guess is
something went wrong in the conversion of either your Save or Load
function. The error I get when trying to load a saved file is:

NullReferenceException

If I try to just open up the text file manually ouside of my app, I
get the following error:

Due to the size of the file, an access error was encountered while
opening the file.

Here's the converted Save and Load functions for you to look at in
case they didn't turn out right when I converted using a utility app.

Public Sub Save(ByVal FileName As String)
Dim l As LineToDraw

Try
If Points.Count < 1 Then
Return
End If
Dim sw As New StreamWriter(FileName, False)

Dim i As Integer
For i = 0 To Points.Count - 1
l = CType(Points(i), LineToDraw)
sw.Write((l.StartX.ToString() + Delimiter))
sw.Write((l.StartY.ToString() + Delimiter))
sw.Write((l.EndX.ToString() + Delimiter))
sw.WriteLine(l.EndY.ToString())
Next i

sw.Close()

Catch
Throw
End Try
End Sub 'Save


Public Sub Load(ByVal FileName As String)
Dim l As LineToDraw

Try
Me.Clear(True)
Dim sr As New StreamReader(FileName)
Dim line As String

While Not (line = sr.ReadLine()) <> Nothing

l = New LineToDraw

Dim linesplit As String() =
line.Split(Delimiter.ToCharArray())

l.StartX = Integer.Parse(linesplit(0).ToString())
l.StartY = Integer.Parse(linesplit(1).ToString())
l.EndX = Integer.Parse(linesplit(2).ToString())
l.EndY = Integer.Parse(linesplit(3).ToString())
Points.Add(l)
End While

sr.Close()
Catch
Throw
End Try
End Sub 'Load

Thanks for any help.
 
G

Guest

Not sure if this is helpful, but I have native (non .NETcf) code to do the
screen capture stuff. You could probably convert this to a DLL that you can
P/Invoke pretty easily. See htp://rburdick.blogspot.com and look at the
wAppearances Code Sample Archive post.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top