UDF > GDIPlus > GraphicsPath >


_GDIPlus_PathGetFillMode

Obtient le mode de remplissage d'un objet GraphicsPath

#include <GDIPlus.au3>
_GDIPlus_PathGetFillMode ( $hPath )

Paramètre

$hPath Handle de l'objet GraphicsPath

Valeur de retour

Succès: Retourne le mode de remplissage de l'intérieur des tracés de figures :
    0 - Alternate: les zones sont remplis conformément à la règle de parité pair-impair
    1 - Winding: Les zones sont remplis selon la règle d'enroulement non nul
Échec: Définit @error <> 0, @extended contient le code erreur GPSTATUS ($GPID_ERR*).

En relation

_GDIPlus_PathSetFillMode

Voir aussi

Consultez GdipGetPathFillMode dans la Librairie MSDN.

Exemple

#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>

Example()

Func Example()
    Local $hGUI, $hGraphic, $hBrush, $hPen, $hPath

    ; Crée une GUI
    $hGUI = GUICreate("GDI+", 300, 220)
    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

    $hBrush = _GDIPlus_BrushCreateSolid(0x7F8800AA)
    $hPen = _GDIPlus_PenCreate(0xFF8800AA, 2)

    $hPath = _GDIPlus_PathCreate(0) ; Crée un objet path
    _GDIPlus_PathAddRectangle($hPath, 50, 50, 100, 100)
    _GDIPlus_PathAddRectangle($hPath, 100, 80, 100, 100)
    _GDIPlus_PathAddRectangle($hPath, 120, 30, 100, 100)

    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
    _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.
    Local $iTimer = TimerInit()
    Do
        If TimerDiff($iTimer) > 1000 Then
            _GDIPlus_PathSetFillMode($hPath, Not _GDIPlus_PathGetFillMode($hPath))
            _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)
            _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)
            $iTimer = TimerInit()
        EndIf
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Nettoie les ressources
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example