drawing rubberband line...

lidds

Junior Contributor
Joined
Nov 9, 2004
Messages
210
Can anyone provide me with a code example in vb.net of how to draw rubberband lines?

Cheers

Simon
 
Hi, just knocked up a simple program to give you an idea. Rubber bands are a nightmare! If you don’t have many primitives to store say up to 10,000 then this technique will do. Otherwise you will need to create a bit map to display the primitives. Using XOR to rub out lines is the traditional way to go, but .net does not have this, except using API calls!

Hope this helps
 

Attachments

Last edited by a moderator:
Thanks I will give this a go tonight.

Just another question, at the moment I have managed to allow the user to draw a line and text onto a existing bmp image (will post code if needed, but do not have access to it at the moment) but what I want to be able to do is identify existing lines, text etc. that have been placed and give the user the option to modify or delete the items without having to go down the MS Paint way of rubbing out the graphics. Any ideas or am I getting into difficult coding??

Cheers

Simon
 
thenerd said:
This is kind of off topic, but what is a rubber band line?


A good example is a selection rectangle, which is seen in, may applications including the Visual Studio designer. For example you click the mouse and drag a rectangle over some objects and when you let go the objects are selected. The rubber band part is where the rectangle stretches to follow the mouse. Rubber band line are used extensively in drawing packages

Hope I make sense!
 
Back
Top