Utilise un pinceau pour remplir l'int�rieur d'un chemin graphique (GraphicsPath)
#include <GDIPlus.au3>
_GDIPlus_GraphicsFillPath ( $hGraphics, $hPath [, $hBrush = 0] )
$hGraphics | Handle de l'objet Graphics |
$hPath | Handle de l'objet GraphicsPath qui sp�cifie le chemin graphique |
$hBrush | [optionnel] Handle de l'objet Brush (pinceau) qui est utilis� pour peindre l'int�rieur du chemin graphique. Si 0, un pinceau noir sera utilis�. |
Succ�s: | Retourne True. |
�chec: | Retourne False et d�finit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*). |
Si la figure form�e par un chemin n'est pas ferm�e, cette fonction traite la figure non ferm�e comme si elle �tait ferm�e par un segment qui relie les points de d�but et de fin de la figure.
Consultez GdipFillPath 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