Function Reference


Sets the blend shape of a path gradient brush to create a custom blend based on a triangular shape

#include <GDIPlus.au3>
_GDIPlus_PathBrushSetLinearBlend ( $hPathGradientBrush, $fFocus [, $fScale = 1] )


$hPathGradientBrush Pointer to a PathGradientBrush object
$fFocus Number in the range 0.0 to 1.0 that specifies where the center color will be at its highest intensity
$fScale [optional] Number in the range 0.0 to 1.0 that specifies the maximum intensity of center color that gets blended with the boundary color

Return Value

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



See Also

Search GdipSetPathGradientLinearBlend in MSDN Library.


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


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

    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_PathBrushSetCenterPoint($hBrush, 100, 90)
    _GDIPlus_PathBrushSetCenterColor($hBrush, 0xFF0000FF)
    _GDIPlus_PathBrushSetLinearBlend($hBrush, 0.25, 0.75)
    _GDIPlus_GraphicsFillPath($hGraphics, $hPath, $hBrush)

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

    ; Clean up resources
EndFunc   ;==>Example