# Function Reference

# _GDIPlus_LineBrushCreateFromRect

Creates a LinearGradientBrush object from a rectangle and boundary colors

#include <GDIPlus.au3>
_GDIPlus_LineBrushCreateFromRect ( $tRECTF, $iARGBClr1, $iARGBClr2 [, $iGradientMode = 0 [, $iWrapMode = 0]] )

## Parameters

$tRECTF | $tagGDIPRECTF that specifies the starting and ending points of the gradient
$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
$iGradientMode | [optional] The direction of the gradient: 0 - Horizontal direction from the left of the display to the right of the display 1 - Vertical direction from the top of the display to the bottom of the display 2 - Forward diagonal direction from the upper-left corner to the lower-right corner of the display 3 - Backward diagonal direction from the upper-right corner to the lower-left corner of the display
$iWrapMode | [optional] 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 ($GDIP_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 GdipCreateLineBrushFromRect in MSDN Library.

## Example

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

    Example()

    Func Example()
        Local $hGUI, $hGraphic, $hBrush, $tRECTF

        $hGUI = GUICreate("GDI+", 420, 320)
        GUISetState(@SW_SHOW)

        _GDIPlus_Startup()
        $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
        _GDIPlus_GraphicsClear($hGraphic, 0xFF000000)

        $tRECTF = _GDIPlus_RectFCreate(10, 10, 400, 300)
        $hBrush = _GDIPlus_LineBrushCreateFromRect($tRECTF, 0xFF000000, 0xFFFFFFFF, 2)
        _GDIPlus_LineBrushSetSigmaBlend($hBrush, 1)

        _GDIPlus_GraphicsFillRect($hGraphic, 10, 10, 400, 300, $hBrush)

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

        ; Clean up resources
        _GDIPlus_BrushDispose($hBrush)
        _GDIPlus_GraphicsDispose($hGraphic)
        _GDIPlus_Shutdown()
    EndFunc   ;==>Example