Function Reference


_GDIPlus_LineBrushCreate

Creates a LinearGradientBrush object from a set of boundary points and boundary colors

#include <GDIPlus.au3>
_GDIPlus_LineBrushCreate ( $nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2 [, $iWrapMode = 0] )

Parameters

$nX1 X coordinate of the starting point of the gradient. The starting boundary line passes through the
$nY1 Y coordinate of the starting point of the gradient. The starting boundary line passes through the
$nX2 X coordinate of the ending point of the gradient. The ending boundary line passes through the
$nY2 Y coordinate of the ending point of the gradient. The ending boundary line passes through the
$iARGBClr1 Alpha, Red, Green and Blue components of the starting color of the line
$iARGBClr2 Alpha, Red, Green and Blue components of the ending color of the line
$iWrapMode [optional] Wrap mode that specifies how areas filled with the brush are tiled:
    0 - Tiling without flipping
    1 - Tiles are flipped horizontally as you move from one tile to the next in a row
    2 - Tiles are flipped vertically as you move from one tile to the next in a column
    3 - Tiles are flipped horizontally as you move along a row and flipped vertically as you move along a column
    4 - No tiling takes place

Return Value

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

Remarks

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

Related

_GDIPlus_BrushDispose

See Also

Search GdipCreateLineBrush in MSDN Library.

Example

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

Example()

Func Example()
    _GDIPlus_Startup() ;initialize GDI+
    Local Const $iWidth = 600, $iHeight = 600, $iBgColor = 0x303030 ;$iBgColor format RRGGBB

    Local $hGUI = GUICreate("GDI+ Example (" & @ScriptName & ")", $iWidth, $iHeight) ;create a test GUI
    GUISetBkColor($iBgColor, $hGUI) ;set GUI background color
    GUISetState(@SW_SHOW)

    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle
    _GDIPlus_GraphicsSetSmoothingMode($hGraphics, $GDIP_SMOOTHINGMODE_HIGHQUALITY) ;sets the graphics object rendering quality (antialiasing)
    Local $hBrush = _GDIPlus_LineBrushCreate(0, 0, 280, 500, 0xFFFF0000, 0xFF4020FF, 1) ;create linear gradient brush

    _GDIPlus_GraphicsFillEllipse($hGraphics, 100, 50, 380, 500, $hBrush) ;draw the egg

    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ;cleanup GDI+ resources
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    GUIDelete($hGUI)
EndFunc   ;==>Example