hello, i'm making a signature into my program.
i'm using a picturebox for the signature, when i run the program i'can make a signature and clear it. Now i want to save the image to a file but picturebox1.image.save("c:\test.jpg") don't work.
error = nullreferenceexception was unhandled
below the code so far
Imports Microsoft.Ink
Imports System.Text
Imports System.IO
Dim JDL_Inkcollector As InkCollector
Private Sub frmKlantenPercent_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
JDL_Inkcollector = New InkCollector(PictureBox1.Handle)
JDL_Inkcollector.Enabled = True
JDL_Inkcollector.AutoRedraw = True
end sub
Private Sub ButtonWissen_Click(sender As System.Object, e As System.EventArgs) Handles ButtonWissen.Click
ModInk.Clear(JDL_Inkcollector, PictureBox1)
End Sub
Private Sub ButtonAkkoord_Click(sender As System.Object, e As System.EventArgs) Handles ButtonAkkoord.Click
PictureBox1.Image.Save("C:\TEST.jpg")
end sub
module : modink
Sub Clear(ByVal InkCollector As InkCollector, ByVal picbox As PictureBox) 'ByVal GroupBox As GroupBox)
InkCollector.Enabled = False ' Disable InkPicture to clear
InkCollector.Ink.DeleteStrokes() ' Clear all strokes
picbox.Invalidate() ' Redraw frame
InkCollector.Enabled = True ' Reenale InkPicture for entry
End Sub
i'm using a picturebox for the signature, when i run the program i'can make a signature and clear it. Now i want to save the image to a file but picturebox1.image.save("c:\test.jpg") don't work.
error = nullreferenceexception was unhandled
below the code so far
Imports Microsoft.Ink
Imports System.Text
Imports System.IO
Dim JDL_Inkcollector As InkCollector
Private Sub frmKlantenPercent_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
JDL_Inkcollector = New InkCollector(PictureBox1.Handle)
JDL_Inkcollector.Enabled = True
JDL_Inkcollector.AutoRedraw = True
end sub
Private Sub ButtonWissen_Click(sender As System.Object, e As System.EventArgs) Handles ButtonWissen.Click
ModInk.Clear(JDL_Inkcollector, PictureBox1)
End Sub
Private Sub ButtonAkkoord_Click(sender As System.Object, e As System.EventArgs) Handles ButtonAkkoord.Click
PictureBox1.Image.Save("C:\TEST.jpg")
end sub
module : modink
Sub Clear(ByVal InkCollector As InkCollector, ByVal picbox As PictureBox) 'ByVal GroupBox As GroupBox)
InkCollector.Enabled = False ' Disable InkPicture to clear
InkCollector.Ink.DeleteStrokes() ' Clear all strokes
picbox.Invalidate() ' Redraw frame
InkCollector.Enabled = True ' Reenale InkPicture for entry
End Sub