UDF > GDIPlus > GraphicsPath >


_GDIPlus_PathAddArc

Ajoute un arc elliptique � la figure actuelle d'un trac�

#include <GDIPlus.au3>
_GDIPlus_PathAddArc ( $hPath, $nX, $nY, $nWidth, $nHeight, $fStartAngle, $fSweepAngle )

Param�tres

$hPath Handle de l'objet GraphicsPath
$nX Coordonn�e X du coin sup�rieur gauche de l'ellipse qui contient l'arc
$nY Coordonn�e Y du coin sup�rieur gauche de l'ellipse qui contient l'arc
$nWidth Largeur du rectangle de d�limitation de l'ellipse qui contient l'arc
$nHeight Hauteur du rectangle de d�limitation de l'ellipse qui contient l'arc
$fStartAngle L'angle, en degr�s, entre l'axe X et le point de d�part de l'arc
$fSweepAngle L'angle, en degr�s, entre les points de d�but et de fin de l'arc

Valeur de retour

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

Voir aussi

Consultez GdipAddPathArc 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+", 400, 300)
    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)

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

    $hPath = _GDIPlus_PathCreate() ; Cr�e un objet path

    _GDIPlus_PathAddArc($hPath, 50, 50, 100, 100, 180, 180)
    _GDIPlus_PathAddArc($hPath, 50, 150, 100, 100, 0, 180)
    _GDIPlus_PathCloseFigure($hPath) ; Connecte le dernier point de ARC2 au premier point de ARC1

    _GDIPlus_PathAddArc($hPath, 250, 50, 100, 100, 180, 180)
    _GDIPlus_PathCloseFigure($hPath) ; Ne connecte pas l'arc
    _GDIPlus_PathAddArc($hPath, 250, 150, 100, 100, 0, 180)
    _GDIPlus_PathCloseFigure($hPath) ; Connecte le dernier point de ARC2 au premier point de ARC2

    _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_PathDispose($hPath)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example