Function Reference


Draws a sequence of lines and curves defined by a GraphicsPath object

#include <GDIPlus.au3>
_GDIPlus_GraphicsDrawPath ( $hGraphics, $hPath [, $hPen = 0] )


$hGraphics Pointer to a Graphics object
$hPath Pointer to a GraphicsPath object that specifies the sequence of lines and curves that make up the
$hPen [optional] Handle to a pen object that is used to draw the splines. If 0, a solid black pen with a width of 1 will be used.

Return Value

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



See Also

Search GdipDrawPath in MSDN Library.


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


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

        ; Create GUI
        $hGUI = GUICreate("GDI+", 420, 160)

        ; Draw a string using path
        $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;Create a graphics object from a window handle
        $hBrush = _GDIPlus_BrushCreateSolid(0xFFDD2200)

        $hPath = _GDIPlus_PathCreate() ;Create new path object

        $hFamily = _GDIPlus_FontFamilyCreate("Arial") ;Create font family object
        $tLayout = _GDIPlus_RectFCreate() ;Create string bounding rectangle X=0, Y=0
        _GDIPlus_PathAddString($hPath, "AutoIt rulez!", $tLayout, $hFamily, 0, 72, 0) ;Add the outline of the string to the path

        _GDIPlus_GraphicsSetSmoothingMode($hGraphic, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;Sets the graphics object rendering quality (antialiasing)
        _GDIPlus_GraphicsClear($hGraphic, 0xFF000000)
        _GDIPlus_GraphicsFillPath($hGraphic, $hPath, $hBrush) ;Fill path to graphics handle (GUI)
        _GDIPlus_GraphicsDrawPath($hGraphic, $hPath, $hPen) ;Draw path to graphics handle (GUI)

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

        ; Clean up resources
EndFunc   ;==>Example