PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2025 → manipuler des Regions non rectangulaires
manipuler des Regions non rectangulaires
Iniciado por nvipilote, 30,nov. 2004 15:07 - 1 respuesta
Publicado el 30,noviembre 2004 - 15:07
Bonjour,

Pour savoir si un point est dans un rectangle pas de problème.

J'aimerais savoir, pour un polygone non rectangulaire, si un point est dans ce polygone.
j'ai essayé diverses syntaxes sans succès.

l'API("GDI32","PtInRegion",hrgn,lx,ly)
renvoie toujours 0.
Comment définir la région hrgn? Cette région peut-elle être un polygone quelconque?

Peut être avec le .NET?
mais comment savoir la méthode et la description des paramètres à employer?

Merci de votre aide.
Mireille

---------------
Publicado el 02,diciembre 2004 - 12:25
This is a multi-part message in MIME format.

------=_NextPart_000_005C_01C4D861.96651210
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

voila ce qu'il y a dans l'aide de l'api Win32


the CreatePolygonRgn function creates a polygonal region.

HRGN CreatePolygonRgn(

CONST POINT *lppt, // address of array of points
int cPoints, // number of points in array
int fnPolyFillMode // polygon-filling mode
);
Parameters

lppt

Points to an array of POINT structures that define the vertices of the =
polygon. The polygon is presumed closed. Each vertex can be specified =
only once.

cPoints

Specifies the number of points in the array.

fnPolyFillMode

Specifies the fill mode used to determine which pixels are in the =
region. This parameter can be one of the following values:

Value Meaning
ALTERNATE Selects alternate mode (fills area between odd-numbered and =
even-numbered polygon sides on each scan line).
WINDING Selects winding mode (fills any region with a nonzero winding =
value).
For more information about these modes, see the SetPolyFillMode =
function.

Return Value

If the function succeeds, the return value is the handle of the region.
If the function fails, the return value is NULL.





"Mireille Epoudry" <nvipilote@wanadoo.fr> a écrit dans le message de =
news: 41ac66c5@news.pcsoft.fr...


Bonjour,

Pour savoir si un point est dans un rectangle pas de problème.

J'aimerais savoir, pour un polygone non rectangulaire, si un point est =

dans ce polygone.
j'ai essayé diverses syntaxes sans succès.

l'API("GDI32","PtInRegion",hrgn,lx,ly)
renvoie toujours 0.
Comment définir la région hrgn? Cette région peut-elle être un =

polygone quelconque?

Peut être avec le .NET?
mais comment savoir la méthode et la description des paramètres =

à employer?

Merci de votre aide.
Mireille

---------------

------=_NextPart_000_005C_01C4D861.96651210
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; =
charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1264" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2><U>voila ce qu'il y a dans l'aide de =
l'api
Win32</U></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial =
size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>the CreatePolygonRgn function creates a =
polygonal
region. </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>HRGN CreatePolygonRgn(</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; CONST POINT&nbsp; =
*lppt,&nbsp;//
address of array of points <BR>&nbsp;&nbsp;&nbsp; int&nbsp; =
cPoints,&nbsp;//
number of points in array <BR>&nbsp;&nbsp;&nbsp; int&nbsp; =
fnPolyFillMode
&nbsp;// polygon-filling mode <BR>&nbsp;&nbsp;
);&nbsp;<BR>Parameters</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>lppt</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Points to an array of POINT structures =
that define
the vertices of the polygon. The polygon is presumed closed. Each vertex =
can be
specified only once.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>cPoints</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Specifies the number of points in the =
array.
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>fnPolyFillMode</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Specifies the fill mode used to =
determine which
pixels are in the region. This parameter can be one of the following =
values:
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial =
size=2>Value&nbsp;Meaning<BR>ALTERNATE&nbsp;Selects
alternate mode (fills area between odd-numbered and even-numbered =
polygon sides
on each scan line).<BR>WINDING&nbsp;Selects winding mode (fills any =
region with
a nonzero winding value).<BR>For more information about these modes, see =
the
SetPolyFillMode function. </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Return Value</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>If the function succeeds, the return =
value is the
handle of the region.<BR>If the function fails, the return value is =
NULL.
</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>"Mireille Epoudry" &lt;</FONT><A
href="mailto:nvipilote@wanadoo.fr"><FONT face=Arial
size=2>nvipilote@wanadoo.fr</FONT></A><FONT face=Arial size=2>&gt; =
a écrit dans
le message de news: </FONT><A =
href="mailto:41ac66c5@news.pcsoft.fr"><FONT
face=Arial size=2>41ac66c5@news.pcsoft.fr</FONT></A><FONT =
face=Arial
size=2>...</FONT></DIV><FONT face=Arial size=2>&gt; <BR>&gt; =
<BR>&gt;
Bonjour,<BR>&gt; <BR>&gt; Pour savoir si un point est dans un rectangle =
pas de
problème. <BR>&gt; <BR>&gt; J'aimerais savoir, pour un polygone non
rectangulaire, si un point est dans ce polygone.<BR>&gt; j'ai essayé =
diverses
syntaxes sans succès.<BR>&gt; <BR>&gt;
l'API("GDI32","PtInRegion",hrgn,lx,ly)<BR>&gt; renvoie toujours =
0.<BR>&gt;
Comment définir la région hrgn? Cette région peut-elle être un =
polygone
quelconque?<BR>&gt; <BR>&gt; Peut être avec le .NET? <BR>&gt; mais =
comment
savoir la méthode et la description des paramètres à =
employer?<BR>&gt; <BR>&gt;
Merci de votre aide.<BR>&gt; Mireille<BR>&gt; <BR>&gt; =
---------------<BR>&gt;
</FONT></BODY></HTML>

------=_NextPart_000_005C_01C4D861.96651210--