HighTechTalks DotNet Forums  

Get mouse click nearest object

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Get mouse click nearest object in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
SP
 
Posts: n/a

Default Get mouse click nearest object - 10-27-2006 , 07:15 AM






Hi,
I've a Object model with line rectangle text and circle. I need to get
the nearest objcet to mouse click point to select and move the object.
I've used GraphicsPath.isVisible, but if I have a rectangle and a line
in it I can't get the line.
I need a function or algorithm to get the nearest object (based on its
coordinates) to this point.
ANy suggestion.

And to get more object Can i use GetRegionScans?


Reply With Quote
  #2  
Old   
Joergen Bech
 
Posts: n/a

Default Re: Get mouse click nearest object - 10-27-2006 , 01:02 PM







Not sure there is anything in the framework that will help
you.

Perhaps this link can help:
http://www.topcoder.com/tc?module=St... int_distance

That would cover point-to-line and by extension point to rectangle
(= 4 lines checked individually). Still need another algorithm to take
care of the circle, though.

/Joergen Bech



On 27 Oct 2006 04:15:51 -0700, "SP" <dario.zandolin (AT) gmail (DOT) com> wrote:

Quote:
Hi,
I've a Object model with line rectangle text and circle. I need to get
the nearest objcet to mouse click point to select and move the object.
I've used GraphicsPath.isVisible, but if I have a rectangle and a line
in it I can't get the line.
I need a function or algorithm to get the nearest object (based on its
coordinates) to this point.
ANy suggestion.

And to get more object Can i use GetRegionScans?


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.