Hi
I am drawing two points (which could have any coordinates), and a path between them. The problem is, I want to know when a user clicks on this path between them. I am confused as to how I would do this. Do I have to get deep into math to calculate the linear path from one point to another, and then manually check if the coords of the mouse line up on this line? Is there a .NET function already for this
Also, I'm pretty sure this is not possible, but is there any way to tie an event handler to a specific thing happening? Like, can I specify that when a user scrolls over a certain region of the form, a certain event will be fired? I'm guessing not, and that I have to consume the MouseOver event and just check if the mouse is in that region..
Thanks
Yaron 1 1354
The GDI+ FAQ has an article on hit-testing lines that will help you.
--
Bob Powell [MVP]
Visual C#, System.Drawing
All you ever wanted to know about ListView custom drawing is in Well Formed. http://www.bobpowell.net/currentissue.htm
Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/gdiplus_faq.htm
*RSS*RSS*RSS*RS S*RSS*RSS*RSS*R SS*RSS*RSS*RSS* RSS*RSS*
The GDI+ FAQ: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder...aspx?FeedId=41
*RSS*RSS*RSS*RS S*RSS*RSS*RSS*R SS*RSS*RSS*RSS* RSS*RSS*
"Yaron" <an*******@disc ussions.microso ft.com> wrote in message
news:DA******** *************** ***********@mic rosoft.com... Hi,
I am drawing two points (which could have any coordinates), and a path
between them. The problem is, I want to know when a user clicks on this path
between them. I am confused as to how I would do this. Do I have to get deep
into math to calculate the linear path from one point to another, and then
manually check if the coords of the mouse line up on this line? Is there a
..NET function already for this? Also, I'm pretty sure this is not possible, but is there any way to tie an
event handler to a specific thing happening? Like, can I specify that when a
user scrolls over a certain region of the form, a certain event will be
fired? I'm guessing not, and that I have to consume the MouseOver event and
just check if the mouse is in that region... Thanks!
Yaron This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: John Roth |
last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which
can be found here:
http://tinyurl.com/2578q
Frankly, I like the idea. It's about time that all of the file
and directory stuff in the os module got objectified
properly (or at least with some semblance of OO propriety!)
In the issues section:
|
by: Michael Hoffman |
last post by:
Many of you are familiar with Jason Orendorff's path module
<http://www.jorendorff.com/articles/python/path/>, which is frequently
recommended here on c.l.p. I submitted an RFE to add it to the Python
standard library, and Reinhold Birkenfeld started a discussion on it in
python-dev
<http://mail.python.org/pipermail/python-dev/2005-June/054438.html>.
The upshot of the discussion was that many python-dev'ers wanted path
added to the...
|
by: Reinhold Birkenfeld |
last post by:
Hi,
the arguments in the previous thread were convincing enough, so I made the
Path class inherit from str/unicode again.
It still can be found in CVS: /python/nondist/sandbox/path/{path.py,test_path.py}
One thing is still different, though: a Path instance won't compare to a regular
string.
|
by: James dean |
last post by:
I have a problem in performance when there are many points in the path.
When updating one point in the path i redraw the whole path again. This
i guess is the problem. What is the most efficient way to update one
point in a path with many points?.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
|
by: James dean |
last post by:
When i draw a path with many points the editing becomes slow. I ran
devPartner and it said that the GDI+ method "GetPathPoints" was taking
up alot of processing time. Also GetPathOutline is slow. Has anybody got
advice on the most efficient way to draw paths in C#.
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
| |
by: flipdoubt |
last post by:
Are there any specialized methods for determining whether a path or UNC points
to a location within a site's web directories? Are there any methods for
turning an absolute path into a relative URL?
My app has UNCs stored in a database and needs to serve the files that the
UNC points to. If the UNC is within the site, I just need to return a relative
path. If it isn't, I need to copy the file to a public cache and return a
relative path...
|
by: theinvisibleGhost |
last post by:
Subject says it all really.
I'm being passed a string, and I'm wondering if theres an easy
way to determine what exactly the string points at?
Cheers
Chris.
|
by: ApexData |
last post by:
Hello
I currently Link the FE/BE using the LinkTables Option and the Linked
Table Manager. Any time I need to move the BE to another location, I
have to go through this process over again. I need the flexibility of
being able to move the BE data to wherever I want, without manually
going through this process. I just want to change the Path/Filename
that I keep in a FE Table.
I want to be able to place a Path/Filename in a FE Table...
|
by: MrColeyted |
last post by:
I am designing an app that is similar to Windows Explorer. I have all working well.
By clicking a directory in the treeview, the folders and files for that directory are displayed in the listview. I want to know how to:
By clicking a folder in the listview, expand and repopulate the corresponding node in the treeview.
I have literally tried everything that I can think of, and I cannot get anything to work. This is for an assignment in...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |