home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!destroyer!ubc-cs!unixg.ubc.ca!heart.ubc.ca!infra
- From: infra@heart.ubc.ca (Infrascan Inc.)
- Subject: How do regions work?
- Message-ID: <1992Aug12.174000.13114@unixg.ubc.ca>
- Sender: news@unixg.ubc.ca (Usenet News Maintenance)
- Nntp-Posting-Host: pulmonary.ubc.ca
- Organization: UBC Pulmonary Research Lab., St. Paul's Hospital, Vancouver, B.C., Canada
- Date: Wed, 12 Aug 1992 17:40:00 GMT
- Lines: 19
-
- I am faced with the task of converting some of my Windows code to run
- under DOS so I'm writing a replacement for CreatePolygonRgn() function. Does
- anyone have any ideas on how Windows handles this internally? Specifically
- I need to be able to create a polygon region of interest and then check
- to see if points are in that region same as with PtInRgn().
- I can think of two possibilities. The first possibility is that
- they count intersections from the edge of the bounding rectangle to determine
- if a point is inside or outside of a region. The second possibility is that
- they treat of hunk of memory like the display and draw the polygon on it.
- Then they do a flood fill inside the polygon setting the inside to 1's and
- the outside to 0's. Then to check if a point is inside the polygon simply
- check if the corresponding memory location is a 0 or 1.
- These are my ideas, any other comments, ideas suggestions or
- disgruntled Microsoft employees who want to e-mail me source code :-) would
- be greatly appreciated.
- --
- Tim Roy
- infra@pulmonary.ubc.ca
- "My employer doesn't even know that I have opinions"
-