UDF > GDIPlus > Graphics >


_GDIPlus_GraphicsDrawBezier

Dessine une courbe de B�zier

#include <GDIPlus.au3>
_GDIPlus_GraphicsDrawBezier ( $hGraphics, $nX1, $nY1, $nX2, $nY2, $nX3, $nY3, $nX4, $nY4 [, $hPen = 0] )

Param�tres

$hGraphics Handle de l'objet Graphics
$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 final
$nY4 Coordonn�e Y du point final
$hPen [optionnel] Handle d'un objet Pen qui sera utilis� pour dessiner la courbe de B�zier. Si 0, un crayon noir qui trace des lignes continues de largeur de 1 sera utilis�.

Valeur de retour

Succ�s: Retourne True.
�chec: Retourne Fale 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 d�finir sa forme.

Voir aussi

Consultez GdipDrawBezier dans la Librairie MSDN.

Exemples

Exemple 1

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

Example()

Func Example()
    Local $hGUI, $hGraphic

    ; Cr�e une GUI
    $hGUI = GUICreate("GDI+", 400, 300)
    GUISetState(@SW_SHOW)

    ; Dessine une courbe de B�zier
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)

    _GDIPlus_GraphicsDrawBezier($hGraphic, 50, 50, 100, 5, 125, 25, 250, 50)

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

    ; Nettoie les ressources
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example

Exemple 2

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

Example()

Func Example()
    _GDIPlus_Startup() ; Initialise GDI+
    Local Const $iWidth = 600, $iHeight = 600, $iBgColor = 0x303030 ; Le format de $iBGColor est RRGGBB

    Local $hGUI = GUICreate("GDI+ example", $iWidth, $iHeight) ; Cr�e une interface de test
    GUISetBkColor($iBgColor, $hGUI) ; D�finit la couleur de fond de la GUI
    GUISetState(@SW_SHOW)

    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ; Cr�e un objet graphique � partir d'un handle de la fen�tre
    _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ; D�finit pour l'objet graphique la qualit� de rendu antialiasing
    Local $hPen = _GDIPlus_PenCreate(0xFFFFFF00, 8) ; Format de couleur AARRGGBB (hex)

    _GDIPlus_GraphicsDrawBezier($hGraphics, 50.25, 350.75, 100.5, 5.5, 125.5, 25.5, 550.5, 550.25, $hPen)

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Nettoie les ressources GDI+
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
EndFunc   ;==>Example