UDF > GDIPlus > GraphicsPath >


_GDIPlus_PathAddBezier

Ajoute une spline de B�zier � la figure courante d'un trac�

#include <GDIPlus.au3>
_GDIPlus_PathAddBezier ( $hPath, $nX1, $nY1, $nX2, $nY2, $nX3, $nY3, $nX4, $nY4 )

Param�tres

$hPath Handle de l'objet GraphicsPath
$nX1 Coordonn�e X du point de d�part
$nY1 Coordonn�e Y du point de d�part
$nX2 Coordonn�e X du premier point de contr�le
$nY2 Coordonn�e Y du premier point de contr�le
$nX3 Coordonn�e X du second point de contr�le
$nY3 Coordonn�e Y du second point de contr�le
$nX4 Coordonn�e X du point de terminaison
$nY4 Coordonn�e Y du point de terminaison

Valeur de retour

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

Remarque

Une courbe de B�zier ne passe pas par les points de contr�le. Les points de contr�le agissent comme des aimants, tirant la courbe dans certaines directions pour influencer la forme de la spline.

Voir aussi

Consultez GdipAddPathBezier dans la Librairie MSDN.

Exemple

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

Example()

Func Example()
    Local $hGUI, $hGraphic, $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)

    $hPen = _GDIPlus_PenCreate(0xFF8800AA, 2)

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

    _GDIPlus_PathAddBezier($hPath, 10, 10, 50, 200, 300, 10, 390, 290)

    _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen)

    ; Boucle jusqu'� ce que l'utilisateur quitte.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

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