Save Drawing2D.GraphicsState to (image)file

webbywally

New member
Joined
Mar 1, 2008
Messages
1
Programming Experience
1-3
Hi everybody!

I'm wondering how I'm suppose to save things that I've drawn on a panel to an imagefile?

I create a graphicsobject(?) and then draw on it with g.DrawLine etc.

This is what I've done and it's completely wrong :p

VB.NET:
    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button14.Click
        Dim g As Graphics = Panel11.CreateGraphics()
        SaveFileDialog1.ShowDialog()
        Dim file As String = SaveFileDialog1.FileName.ToString
        Dim img As Drawing.Drawing2D.GraphicsState
        img = g.Save()

        MessageBox.Show("Saved to file: " & file)

    End Sub

Thanks everybody!

webbywally
 
Back
Top