.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 18th, 2008, 09:42 AM
mateoc15's Avatar
mateoc15 mateoc15 is offline
Business Analyst
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Mar 2004
Location: The 'Ville
Posts: 1,087 mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 19 h 17 m 11 sec
Reputation Power: 21
Question Detect mouse click in irregular area

I want to capture a mouse click on a PictureBox and perform one action if it is in area A but a different action if it is in area B. Unfortunately the shape is not a rectangle or circle. It will be more or less a semi-circle. I don't want to actually draw this semi-circle, just be able to tell whether or not the click is in the given area using some kind of coordinate system.

I know how to capture a mouse click in general, just need help with the specific area part.

Well, now that I think about it, this is really pretty similar to an old-school image map hyperlink in HTML!

Any ideas?

Thanks!
__________________
Discontent is the first necessity of progress. - Edison

Last edited by mateoc15 : July 18th, 2008 at 09:48 AM.

Reply With Quote
  #2  
Old July 18th, 2008, 10:03 AM
LyonHaert's Avatar
LyonHaert LyonHaert is offline
Arcane Scribbler
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2005
Location: Indianapolis, IN
Posts: 1,907 LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level)LyonHaert User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 1 Day 6 h 33 m 15 sec
Reputation Power: 583
Rectangle and RectangleF have bool IntersectsWith() methods.

Region has several bool IsVisible() overloads, one of which is bool IsVisible( Point ).

Even GraphicsPath can be used because one of Region's constructors takes a GraphicsPath argument.

System.Drawing.Region.IsVisible()

Edit: There may even be better ways of doing hit testing, but I don't know 'em. Yet.
__________________
Joel B Fant
"An element of conflict in any discussion is a very good thing. Shows everybody's taking part, nobody left out. I like that."

.NET Must-Haves
Tools: Reflector
References: Threading in .NET

Reply With Quote
  #3  
Old April 21st, 2012, 10:30 AM
mateoc15's Avatar
mateoc15 mateoc15 is offline
Business Analyst
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Mar 2004
Location: The 'Ville
Posts: 1,087 mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level)mateoc15 User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 3 Days 19 h 17 m 11 sec
Reputation Power: 21
Any idea how this works in WPF?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Detect mouse click in irregular area

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap