?
Solved

Test if a point within an irregular poligon region

Posted on 2003-03-12
3
Medium Priority
?
349 Views
Last Modified: 2008-02-01
Hi,

I need to test if a point (x, y) is inside an irregular poligon region, if there already any MFC method that accomplish it, or if there any algoritm that is ready to stuff in my code?

TIA
0
Comment
Question by:mauling
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 8118762
What is the way you keep a polygon information?
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 8118869
Check out the following functions (available both as API and CRgn class members):

CreatePolygonRgn
CreatePolyPolygonRgn
CombineRgn

(for creating region objects)

and:

PtInRegion

(to test if point is inside a region).
0
 
LVL 1

Accepted Solution

by:
oferh earned 1000 total points
ID: 8118874
you can use CRgn::CreatePolygonRgn to create a polygon
and then CRgn::PtInRegion to check if a point is in that region.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses
Course of the Month8 days, 3 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question