Libère un objet GraphicsPath
#include <GDIPlus.au3>
_GDIPlus_PathDispose ( $hPath )
$hPath | Handle de l'objet GraphicsPath |
Succès: | Retourne True. |
Échec: | Retourne False et définit @error <> 0, @extended contient le code erreur ($GPID_ERR*). |
Consultez GdipDeletePath dans la Librairie MSDN.
#include <GDIPlus.au3> #include <GUIConstantsEx.au3> Example() Func Example() Local $hGUI, $hGraphic, $hBrush, $hPen, $hPath, $hFamily, $tLayout ; Crée une GUI $hGUI = GUICreate("GDI+", 420, 160) GUISetState(@SW_SHOW) ; Dessine une chaîne en utilisant un Path _GDIPlus_Startup() $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ; Crée un objet graphique à partir du handle de la fenêtre $hBrush = _GDIPlus_BrushCreateSolid(0xFFDD2200) $hPen = _GDIPlus_PenCreate(0xFFFFBB00, 2) $hPath = _GDIPlus_PathCreate() ; Crée un objet path $hFamily = _GDIPlus_FontFamilyCreate("Arial") ; Crée un objet FontFamily $tLayout = _GDIPlus_RectFCreate() ; Crée une chaîne délémitée par un rectangle de coin X=0, Y=0 _GDIPlus_PathAddString($hPath, "AutoIt rulez!", $tLayout, $hFamily, 0, 72, 0) ; Ajoute le contour de la chaîne au Path _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; Définit pour l'objet graphique la qualité de rendu antialiasing _GDIPlus_GraphicsClear($hGraphic, 0xFF000000) _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ; Dessine le Path avec le handle Graphic (GUI) _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ; Dessine le Path avec le handle Graphic (GUI) ; Boucle jusqu'à ce que l'utilisateur quitte. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE ; Nettoie les ressources _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_PathDispose($hPath) _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_Shutdown() EndFunc ;==>Example