Skip to main content
gamedev.net
🔒 Locked

VB Line Question

Started by Mark04 Feb 17, 2005 at 4:41 PM 6 replies 1k views
Original Post
Mark04
Mark04
Hi. In Visual Basic, I draw a line in a picture box as follows: PictureBox1.Line (100,100) - (500,500) Now, my question is how I can I delete this line from the picture box if I no longer want it? Note, I tried CLS but that clears the whole screen (I may have other lines that I do not want to delete). Thanks. Mark.
FrankCashio
FrankCashio
Maybe draw another line or a box over it with the background color. Like the dirty box method. Page swaping, fliping, Zero the memory out and all that good crap.

-Frank
remmargorp
remmargorp
without redrawing the rest of the image or re-drawing a section around where the line was removed you can't by simple commands. You would want to create a shape object or line object, give it an index of 0 and dynamically create a line and move it within the picture box. by removing/hiding that line you would effectively remove it and keep the contents below/above
chollida1
chollida1
XOR drawing is your friend, antialiasing isnt:)

CHeers
Chris
CheersChris
chollida1
chollida1
yes some drawing programs do that, they redraw the line with the xor pen which erases the pen wiht the same color. Its not perfect and antialiasing will bugger the whole thing up but it could get you close to what you want!!

Cheers
Chris
CheersChris
Mark04
Mark04
Quote:
Original post by chollida1
yes some drawing programs do that, they redraw the line with the xor pen which erases the pen wiht the same color. Its not perfect and antialiasing will bugger the whole thing up but it could get you close to what you want!!

Cheers
Chris


Hi.

I have got it working great!!

Somehow, I just used Not XOR (10) to erase the previous line and Copy Pen (13) to put the new line in. All other lines on the screen remained untouched, even if they new line crossed over it!

Thanks anyway

Mark.
chollida1
chollida1
Glad I could help!!

Cheers
Chris
CheersChris

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.