UDF > GDIPlus > Graphics >


_GDIPlus_GraphicsFillPath

Utilise un pinceau pour remplir l'intérieur d'un chemin graphique (GraphicsPath)

#include <GDIPlus.au3>
_GDIPlus_GraphicsFillPath ( $hGraphics, $hPath [, $hBrush = 0] )

Paramètres

$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é.

Valeur de retour

Succès: Retourne True.
Échec: Retourne False et définit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*).

Remarque

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.

En relation

_GDIPlus_PathCreate

Voir aussi

Consultez GdipFillPath dans la Librairie MSDN.

Exemple

#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