kevinheeney Posted July 14, 2003 Posted July 14, 2003 (VB.NET) I have for some time been trying to figure out how to create user selectable lines. If anybody could point me in some direction. I have tried many things such as making lines claim regions of the picturebox but if the user draws a line near that one and tries to click, it does not know which line they are licking. What I am looking for is simple vector style lines, such as what filemaker uses, Flash or pretty much any application that has lines(except MSPaint). I want to be able to select a line after drawing it, and then delete it or what not. KO Quote
*Gurus* divil Posted July 14, 2003 *Gurus* Posted July 14, 2003 You could calculate the positions of the pixels that make up the line and follow them, comparing the mouse cursor's position to see if it's within a set distance from that pixel. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
ballisticnylon Posted July 14, 2003 Posted July 14, 2003 Here's a good article on the subject. It's in C#, but hopefully you'll be able to figure out the basic idea: http://www.bobpowell.net/hittestlines.htm Quote "It may be roundly asserted that human ingenuity cannot concoct a cipher which human ingenuity cannot resolve." - Edgar Allan Poe, 1841 I long to accomplish great and noble tasks, but it is my chief duty to accomplish humble tasks as though they were great and noble. The world is moved along, not only by the mighty shoves of its heroes, but also by the aggregate of the tiny pushes of each honest worker. - Helen Keller
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.