Funktionsreferenz

_GDIPlus_BrushGetSolidColor

Liefert die Farbe eines vollfarbigen Füllmuster-Objekts.

#Include <GDIPlus.au3>
_GDIPlus_BrushGetSolidColor($hBrush, [$iARGB = 0xFF000000])

 

Parameter

$hBrush Handle zu einem Füllmuster-Objekt.
$iARGB [optional] Die Farbe des Füllmuster-Objekts.

 

Rückgabewert

Erfolg: Füllmusterfarbe
Fehler: -1 und @error wird gesetzt

 

Bemerkungen

Keine.

 

Verwandte Funktionen

 

Siehe auch

Suche in der MSDN Bibliothek nach GdipGetSolidFillColor

 

Beispiel


#AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>

Opt('MustDeclareVars', 1)

_Main()

Func _Main()
    Local $hGUI, $Label1, $label2, $hGraphic, $hBrush1, $iClr1, $iClr2

    ; Erstellt ein GUI
    $hGUI = GUICreate("GDI+", 345, 150)
    $Label1 = GUICtrlCreateLabel("", 2, 2, 150, 20)
    $label2 = GUICtrlCreateLabel("", 202, 2, 150, 20)
    GUISetState()
    Sleep(100)

    ; Startet GDIPlus
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)

    ; Erstellt ein vollfarbiges Füllmuster
    $hBrush1 = _GDIPlus_BrushCreateSolid()

    ; Fragt Farbe des vollfarbigen Füllmusters ab (Anm: Da keine Farbe angegeben wurde, ist diese schwarz)
    $iClr1 = _GDIPlus_BrushGetSolidColor($hBrush1)

    ; Zeichnet ein paar Grafiken mit dem orginalen Füllmuster
    _GDIPlus_GraphicsFillEllipse($hGraphic, 25, 25, 100, 100, $hBrush1)

    ; Setzt ein neues Füllmuster (0xFFFF0000 = Red)
    _GDIPlus_BrushSetSolidColor($hBrush1, 0xFFFF0000)

    ; Fragt Farbe des neuen Füllmusters ab
    $iClr2 = _GDIPlus_BrushGetSolidColor($hBrush1)

    ; Zeichnet ein paar Grafiken mit der neuen Füllmusterfarbe
    _GDIPlus_GraphicsFillRect($hGraphic, 220, 25, 100, 100, $hBrush1)

    ; Schreibt die originale Füllmusterfarbe in Label1
    GUICtrlSetData($Label1, "Füllmuster orignale Farbe: " & Hex($iClr1))

    ; Schreibt die neue Füllmusterfarbe in Label2
    GUICtrlSetData($label2, "Füllmuster neue Farbe: " & Hex($iClr2))

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

    ; Ressourcen freigeben
    _GDIPlus_BrushDispose($hBrush1)
    _GDIPlus_GraphicsDispose($hGraphic)
    _GDIPlus_Shutdown()

EndFunc   ;==>_Main