lidds Posted February 8, 2005 Posted February 8, 2005 Can anyone provide me with a code example in vb.net of how to draw rubberband lines? Cheers Simon Quote
AlexCode Posted February 8, 2005 Posted February 8, 2005 This is one way of doing it: http://msdn.microsoft.com/library/default.asp?url=/archive/en-us/dnaraskdr/html/askgui02172004.asp Alex :p Quote Software bugs are impossible to detect by anybody except the end user.
lidds Posted February 9, 2005 Author Posted February 9, 2005 Cheers Alex, will have a look at that. Quote
Talyrond Posted February 9, 2005 Posted February 9, 2005 (edited) 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 Rubberband.zipFetching info... Edited February 9, 2005 by PlausiblyDamp Quote
lidds Posted February 9, 2005 Author Posted February 9, 2005 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 Quote
Talyrond Posted February 9, 2005 Posted February 9, 2005 Hi, I would strongly recommend that you take a look at Bob Powells site: http://www.bobpowell.net/faqmain.htm in particular: http://www.bobpowell.net/manipulate_graphics.htm there is a wealth of info on the site, let us know if it was of any help Quote
thenerd Posted February 9, 2005 Posted February 9, 2005 This is kind of off topic, but what is a rubber band line? Quote
Talyrond Posted February 9, 2005 Posted February 9, 2005 Quote This is kind of off topic' date=' but what is a rubber band line?[/quote'] 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! Quote
Wile Posted February 10, 2005 Posted February 10, 2005 So it would be something like these two ?: http://www.codeproject.com/cs/miscctrl/CSharpRectTracker.asp http://www.codeproject.com/cs/miscctrl/CSPickBoxSample1.asp Quote Nothing is as illusive as 'the last bug'.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.