What's the best way to clear the result of Drawline() on a Picture

G

Guest

Hi all,

My first post to MSDN... I've recently started to get into VB.NET, having
been a casual VB user for a few years. So far, it's going OK. I've managed
to figure out
how to draw lines on a PictureBox, using code like this:

g = PictureBox1.CreateGraphics()
p = New Pen(char_color, pen_width)
p.LineJoin = Drawing2D.LineJoin.Round

g.DrawLine(p, path.s.X, path.s.Y, path.e.X, path.e.Y)


and that's just peachy. What I'd like to do now is erase the lines and have
the
PictureBox revert back to the jpeg it started with.

At first it seemed like

g.Clear()

was going to do it, but I don't want to fill the box with a color- I want it
to show the
original picture.

Any hints would be greatly appreciated. Thank you.

Pat Ferrick
 
G

Guest

You'll have to reload the graphics from where ever you loaded it from. By
drawing on the picture you've actually modified the bitmap that you
originally loaded.
 

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