Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have developed a Visual Basic.NET application, with a picture box on the main form. I user aquires and image and it loads into the PictureBox, the User can then draw lines, rectangles etc.. using the mouse on the picture box image. The problem comes in when the user scrolls down on the image the marks they previously made disappear. How can I prevent this from happening? Any help is greatly appreciated.
Posted

You want to store everything you draw onto a bitmap image that's not connected to the picturebox so it won't refresh and delete everything you drew.

 

Basically:

 

dim buff as bitmap = new bitmap(picturebox.width, picturebox.height)
dim g as graphics = graphics.fromimage(buff)

'blah, use g to draw some stuff to buff instead of using it to draw to picturebox.  

picturebox.image = buff

 

Or something similar to that.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...