home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / mswindo / programm / misc / 1295 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.5 KB  |  31 lines

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