Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Polygon trouble. How to determine location

Status
Not open for further replies.

lemming999

Programmer
Mar 11, 2002
12
0
0
IE
Anyone know how to determine which polygon a user has clicked on screen, without using getPixel. I want to add a function that allows a user to delete Polygons from the screen by clicking on it. I want to do this by only referring to coordinates of Polygon (Polygon is 4 coordinates).

Any help would be gratefully received
 
I assume you use MFC. Otherwise you have to implement the algorithm yourself.

In the context of MFC, You can use CRgn class to declare your polygon and use PtInRgn() to test if a point is inside this polygon.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top