Click to See Complete Forum and Search --> : Combining Regions


ncl
February 18th, 2000, 07:00 AM
I'm trying to create a new polygon region from the overlay of 2 existing polygon regions. On trying this I get something, but I'm unsure how I specify a blank polygon. How then do I get out of the new region the vertices of the new polygon ?

My (simple) code so far looks like


hregions(0) = CreatePolygonRgn(po1api(0), 4, WINDING)
hregions(1) = CreatePolygonRgn(po2api(0), 4, WINDING)
Dim hcombined&
Dim po3api(25) as POINTAPI
for q = 0 to 25
po3api(q).X = 0
po3api(0).Y = 0
next
hcombined = CreatePolygonRgn(po3api(0), 4, WINDING)

Dim d as Long

d = CombineRgn(hcombined, hregions(0), hcombined, RGN_COPY)
d = CombineRgn(hcombined, hregions(1), hcombined, RGN_AND)
MsgBox d

for q = 0 to UBound(po3api)
Debug.print po3api(q).X, po1api(q).Y
next





Many thanks