Saving Ink Pictures

I'm using the ink picture control and I'm having trouble getting my code to work.  I think I'm on the right track but I just cant figure it out.  Please help me I've been stuck on this for days. Thanks in advance  :)
Dim inkBounds As Rectangle
 
        With inkBounds
 
            .X = 0
 
            .Y = 0
 
            .Width = InkPicture1.Width
 
            .Height = InkPicture1.Height
 
        End With
 
        Dim img As Image
 
 
        img.Save(IO.Directory.GetCurrentDirectory() & "\test_out.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)

Open in new window

lolwtfAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
I dont know what you are trying to do but the following lines would definitely produce error
Dim img As Image
img.Save(IO.Directory.GetCurrentDirectory() & "\test_out.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)

And the error would be "Object reference not set to an instance of an object".

Please explain what you are trying to do.
0
lolwtfAuthor Commented:
I'm using the ink picture control, something you would use on a tablet pc.  Basically all i want to do is save the contents of the ink picture to a jpeg.
0
CodeCruiserCommented:
Do this
InkPicture1.Image.Save(IO.Directory.GetCurrentDirectory() & "\test_out.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
0
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

lolwtfAuthor Commented:
Okay I tried the line of code that you provided but still not having any luck.  Ive downloaded the tutorial, but the problem is he saves it as  a rtf file and not a jpeg.  Doing that only allows you to view the picture inside the program.  
0
CodeCruiserCommented:
Well try this as a test

InkPicture1.Image.Save("C:\test_out.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
0
lolwtfAuthor Commented:
I keep getting an object reference not set to an instance of an object exception.  Do you think the rest of the code is right?
0
CodeCruiserCommented:
From the code you have given above in the question, DELETE EVERYTHING. You do not need any of that.

Just use this like and make sure the name of the control is correct and it exists.

If Not Isnothing(InkPicture1.Image) Then
   InkPicture1.Image.Save("C:\test_out.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
Else
   Messagebox.show ("No image!")
End If
0
CodeCruiserCommented:
The above code would probably show you the messagebox, then try the following link

http://weblogs.asp.net/nleghari/archive/2004/08/04/207583.aspx



0
lolwtfAuthor Commented:
It just keeps giving me exceptions.  The name of the control is correct and everything should work.  I'm wondering since its a windows xp tablet software control, if its vista that's screwing up
0
lolwtfAuthor Commented:
Ive never done C# before so ill try my best to try and convert it
0
lolwtfAuthor Commented:
Lol sorry i still need a little help.  I dragged and dropped a savefiledialog on my form and converted the C# code this far:
Dim r As New Renderer
        Dim b2 As Bitmap
        Dim g1 As Graphics
 
 
 
 
 
 
 
 
        If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
 
 
 
            r.Draw(g1, InkPicture1.Ink.Strokes)
 
 
        End If
 
 
 
 
    End Sub

Open in new window

0
CodeCruiserCommented:
Use the following free online tool to convert C# to VB

http://www.developerfusion.com/tools/convert/csharp-to-vb/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lolwtfAuthor Commented:
Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.