Funktionreferenz


_GDIPlus_PathAddBezier


Adds a bezier spline to the current figure of a path

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

Parameter

$hPath Pointer to a GraphicsPath object
$nX1 X coordinate of the starting point
$nY1 Y coordinate of the starting point
$nX2 X coordinate of the first control point
$nY2 Y coordinate of the first control point
$nX3 X coordinate of the second control point
$nY3 Y coordinate of the second control point
$nX4 X coordinate of the ending point
$nY4 Y coordinate of the ending point

Rückgabewert

Success: True.
Failure: False and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3).

Bemerkungen

A Bezier spline does not pass through its control points. The control points act as magnets, pulling the curve in certain directions to influence the way the spline bends.

Siehe auch

Suche nach GdipAddPathBezier in der MSDN Bibliothek.

Beispiel

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

Example()

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

    ; Create GUI
    $hGUI = GUICreate("GDI+", 400, 300)
    GUISetState(@SW_SHOW)

    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle
    _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing)
    _GDIPlus_GraphicsClear($hGraphic, 0xFFFFFFFF)

    $hPen = _GDIPlus_PenCreate(0xFF8800AA, 2)

    $hPath = _GDIPlus_PathCreate() ;Create new path object

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

    _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen)

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Clean up resources
    _GDIPlus_PathDispose($hPath)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example