nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

PtInRegion

Von: Thomas Cebulla (cebulla@sup-scs.de) [Profil]
Datum: 11.07.2008 17:58
Message-ID: <Xns9AD8B68D42996301266@130.133.1.18>
Newsgroup: de.comp.lang.delphi.misc
Hi,

ich habe eine rechteckige Region erzeugt

type
PList = ^TPoints_i;
TPoints_i = array of TPoint;
var
Points: TPoints_i;
Region: HRGN;

SetLength(Points, 4);
Points[0]:= apoint(-100, -100);
Points[1]:= apoint(+100, -100);
Points[2]:= apoint(+100, +100);
Points[3]:= apoint(-100, +100);

Region := CreatePolygonRgn(PList(@Points[0])^, 4, 1);

Jetzt teste mit PtInRegion, ob Punkte innerhalb dieser Region sind.
abool:= PtInRegion(Region, Points[i].x, Points[i].y)

Das Ergebnis ist für
P1 (-100,   0) true
P2 (+100,   0) false
P3 (   0,-100) false
P4 (   0,+100) false

Alle 4 Punkte liegen auf dem Rand der Region.
Hat jemand eine Idee, warum ausgerechnet Punkt 1 true ergibt und alle 3
anderen false?

Thomas

[ Auf dieses Posting antworten ]