Function Reference


_GDIPlus_LineBrushGetRect

Gets the rectangle that defines the boundaries of a linear gradient brush

#include <GDIPlus.au3>
_GDIPlus_LineBrushGetRect ( $hLineGradientBrush )

Parameters

$hLineGradientBrush Pointer to a LinearGradientBrush object

Return Value

Success: an array containing the rectangle boundaries:
    [0] - X coordinate of the upper-left corner of the rectangle
    [1] - Y coordinate of the upper-left corner of the rectangle
    [2] - Width of the rectangle
    [3] - Height of the rectangle
Failure: sets the @error flag to non-zero, @extended may contain GPSTATUS error code ($GPID_ERR*).

See Also

Search GdipGetLineRect in MSDN Library.

Example

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

Example()

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

    $hGUI = GUICreate("GDI+", 400, 300)
    GUISetState(@SW_SHOW)

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

    $hBrush = _GDIPlus_LineBrushCreate(10, 10, 390, 290, 0xFF000000, 0xFFFFFFFF)

    $aRect = _GDIPlus_LineBrushGetRect($hBrush)
    _GDIPlus_GraphicsFillRect($hGraphic, $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_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example