Funktionreferenz


_GDIPlus_LineBrushCreateFromRect


Creates a LinearGradientBrush object from a rectangle and boundary colors

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

Parameter

$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

Rückgabewert

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

Bemerkungen

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

Verwandte Funktionen

_GDIPlus_BrushDispose

Siehe auch

Suche nach GdipCreateLineBrushFromRect in der MSDN Bibliothek.

Beispiel

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

    ; 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