Function _GDIPlus_PathIterNextMarkerPath

Function Reference


Gets the next marker-delimited section of an iterator's associated path

#include <GDIPlus.au3>
_GDIPlus_PathIterNextMarkerPath ( $hPathIter, $hPath )


$hPathIter Pointer to a GraphicsPathIterator object
$hPath Pointer to a GraphicsPath object

Return Value

Success: the number of point in the retrieved section or 0 if no more sections to be retrieved
Failure: -1 and sets the @error flag to non-zero, @extended may contains GPSTATUS error code ($GDI_ERR*).


This function sets the data points of the specified GraphicsPath object to match the data points of the retrieved section.


_GDIPlus_PathIterRewind, _GDIPlus_PathSetMarker

See Also

Search GdipPathIterNextMarkerPath in MSDN Library.


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


Func Example()
    Local $hGUI = GUICreate("GDI+", 600, 300)

    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    Local $hBmp_Buffer = _GDIPlus_BitmapCreateFromGraphics(600, 300, $hGraphics)
    Local $hGfx_Buffer = _GDIPlus_ImageGetGraphicsContext($hBmp_Buffer)
    _GDIPlus_GraphicsSetSmoothingMode($hGfx_Buffer, $GDIP_SMOOTHINGMODE_HIGHQUALITY)
    _GDIPlus_GraphicsClear($hGfx_Buffer, 0xFF000000)

    Local $hBrush = _GDIPlus_BrushCreateSolid(0xFFAA00FF)
    Local $hPen = _GDIPlus_PenCreate(0xFFFFBB00, 2)

    Local $hPath = _GDIPlus_PathCreate()
    Local $hFormat = _GDIPlus_StringFormatCreate()
    _GDIPlus_StringFormatSetAlign($hFormat, 1)
    Local $hFamily = _GDIPlus_FontFamilyCreate("Arial")
    Local $tLayout = _GDIPlus_RectFCreate(0, 0, 600, 300)
    _GDIPlus_PathAddString($hPath, "AutoIt rulez!", $tLayout, $hFamily, 0, 112, $hFormat)

    Local $hIter = _GDIPlus_PathIterCreate($hPath)
    Local $hSubPath = _GDIPlus_PathCreate();Path to get the subpath figure

    Local $iPointCount
    While 1

        ;e.g. The letter A is composed of two sub-paths - compare with _GDIPlus_PathIterNextSubpathPath
        $iPointCount = _GDIPlus_PathIterNextMarkerPath($hIter, $hSubPath)
        If $iPointCount <= 0 Then ExitLoop ;No more figures

        _GDIPlus_PenSetColor($hPen, BitOR(0xFF000000, Random(0xFF, 0xFFFFFF, 1)))
        _GDIPlus_BrushSetSolidColor($hBrush, BitOR(0xFF000000, Random(0xFF, 0xFFFFFF, 1)))

        _GDIPlus_GraphicsFillPath($hGfx_Buffer, $hSubPath, $hBrush)
        _GDIPlus_GraphicsDrawPath($hGfx_Buffer, $hSubPath, $hPen)

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBmp_Buffer, 0, 0)

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

    ; Clean up resources
EndFunc   ;==>Example