Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

VS 2010 microsoft.ink save picturebox

$
0
0
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

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>