Function Reference


_GDIPlus_PathBrushCreateFromPath

Creates a PathGradientBrush object based on a GraphicsPath object

#include <GDIPlus.au3>
_GDIPlus_PathBrushCreateFromPath ( $hPath )

Parameters

$hPath Pointer to a GraphicsPath object that specifies the boundary path of the path gradient brush

Return Value

Success: a pointer to a new PathGradientBrush object.
Failure: 0 and sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPIP_ERR* see GPIPlusConstants.au3).

Remarks

After you are done with the object, call _GDIPlus_BrushDispose() to release the object resources.

Related

_GDIPlus_BrushDispose

See Also

Search GdipCreatePathGradientFromPath in MSDN Library.

Example

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

Example()

Func Example()
        Local $hGUI = GUICreate("GDI+", 200, 180)
        GUISetState(@SW_SHOW)

        _GDIPlus_Startup()
        Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI)
        _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY)
        _GDIPlus_GraphicsClear($hGraphics, 0xFF000000)

        Local $hPath = _GDIPlus_PathCreate()
        _GDIPlus_PathAddEllipse($hPath, 10, 10, 180, 160)

        Local $hBrush = _GDIPlus_PathBrushCreateFromPath($hPath)
        _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFFFFFF00)
        _GDIPlus_PathBrushSetCenterPoint($hBrush, 90, 80)
        _GDIPlus_PathBrushSetSurroundColor($hBrush, 0xFF0000FF)

        _GDIPlus_PathBrushSetGammaCorrection($hBrush, True)

        Local $aRect = _GDIPlus_PathBrushGetRect($hBrush)
        _GDIPlus_GraphicsFillRect($hGraphics, $aRect[0], $aRect[1], $aRect[2], $aRect[3], $hBrush)

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

        ; Clean up resources
        _GDIPlus_BrushDispose($hBrush)
        _GDIPlus_PathDispose($hPath)
        _GDIPlus_GraphicsDispose($hGraphics)
        _GDIPlus_Shutdown()
EndFunc   ;==>Example