Hi!
Habe gerade den Post Icon auf Bild gelesen und dachte an ein altes Leiden
mit den Button, ich habe hin und wieder mal nach einer Möglichkeit gesucht, bis jetzt nichts gefunden.
Beispiel Färbet man den Hintergrund der Form ganz normal mit GUISetBkColor ist alles gut, Setzt ich aber mit GUICtrlSetGraphic eine Grafik und darüber ein Button " Bilder sagen alles, einmal mit schwarz einmal mit weiß"
Ein beispiel Code:
Spoiler anzeigen
#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]Local $aWColor[3] = [50, 125, 300], $aLColor[3] = [25, 255, 255]
$guiBox = GUICreate('', 500, 500, -1, -1)
;GUISetBkColor('')
;GUISetBkColor(0x1788A7)
GUICtrlCreateButton('0', 50, 50, 150, 50)
GUICtrlCreateButton('1', 50, 150, 150, 50)
GUICtrlCreateButton('2', 50, 250, 150, 50)
GUICtrlCreateButton('3', 50, 350, 150, 50)
GUICtrlCreateButton('3', 250, 50, 100, 40)
GUICtrlCreateButton('4', 250, 150, 70, 30)
GUICtrlCreateButton('5', 250, 250, 50, 20)
GUICtrlCreateButton('6', 250, 350, 20, 15)
If SetBkColor(GUICtrlCreateGraphic(0, 0, 500, 500), 500, 500, $aWColor, $aLColor) Then GUISetState()
;GUISetState()
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
[/autoit] [autoit][/autoit] [autoit]Exit
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]Func SetBkColor($hGraphic, $Width, $Height, $lc, $rc)
If ($hGraphic And $Width And $Height And IsArray($lc) And IsArray($rc)) Then
For $i = 0 To $Height
GUICtrlSetGraphic($hGraphic, 8, Dec(Hex(($lc[0] - Floor($i * ($lc[0] - $rc[0]) / $Height)), 2) & _
Hex(($lc[1] - Floor($i * ($lc[1] - $rc[1]) / $Height)), 2) & Hex(($lc[2] - Floor($i * ($lc[2] - $rc[2]) / $Height)), 2)))
GUICtrlSetGraphic($hGraphic, 6, 0, $i)
GUICtrlSetGraphic($hGraphic, 2, $Width, $i)
Next
Return GUICtrlSetGraphic($hGraphic, 22)
EndIf
Return False
EndFunc ;==>SetBkColor
Kennt da vielleicht einer eine Möglichkeit den Rand Transparent o. weg zu bekommen?
Lg Kleiner