Obtient le point de terminaison de la derni�re figure d'un objet GraphicsPath
#include <GDIPlus.au3>
_GDIPlus_PathGetLastPoint ( $hPath )
$hPath | Handle de l'objet GraphicsPath |
Succ�s: | Retourne un tableau contenant les coordonn�es du point: [0] - Coordonn�e X du point [1] - Coordonn�e Y du point |
�chec: | D�finit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*). |
Consultez GdipGetPathLastPoint dans la Librairie MSDN.
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $hGUI, $hGraphic, $hPen, $hPath, $aPnt ; Cr�e une GUI $hGUI = GUICreate("GDI+", 400, 400) GUISetState(@SW_SHOW) _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ; Cr�e un objet graphique � partir du handle de la fen�tre _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; D�finit pour l'objet graphique la qualit� de rendu antialiasing _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF) $hPen = _GDIPlus_PenCreate(0xFF8800AA, 2) $hPath = _GDIPlus_PathCreate() ; Cr�e un objet path _GDIPlus_PathAddArc($hPath, 50, 50, 300, 300, Random(0, 360), Random(30, 270)) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ; Dessine le Path avec le handle Graphic (GUI) _GDIPlus_PenSetColor($hPen, 0xFF00AA00) $aPnt = _GDIPlus_PathGetLastPoint($hPath) _GDIPlus_GraphicsDrawRect($hGraphic, $aPnt[0] - 5, $aPnt[1] - 5, 10, 10, $hPen) _GDIPlus_PathReverse($hPath) $aPnt = _GDIPlus_PathGetLastPoint($hPath) _GDIPlus_GraphicsDrawRect($hGraphic, $aPnt[0] - 5, $aPnt[1] - 5, 10, 10, $hPen) ; Boucle jusqu'� ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Nettoie les ressources _GDIPlus_PathDispose($hPath) _GDIPlus_PenDispose($hPen) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example