Funktionreferenz


_GDIPlus_LineBrushGetRect


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

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

Parameter

$hLineGradientBrush Pointer to a LinearGradientBrush object

Rückgabewert

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 ($GPIP_ERR* see GPIPlusConstants.au3).

Bemerkungen

None.

Siehe auch

Suche nach GdipGetLineRect in der MSDN Bibliothek.

Beispiel

#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)

    ; Die Schleife wiederholt sich, bis der Benutzer die Beenden-Aktion der GUI auslöst.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE

    ; Ressourcen freigeben
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()
EndFunc   ;==>Example