Hallo Leute, ich mal wieder,
heute quält mich folgendes Problem. Ich würde gern ein transparentes Icon, das in einer dll steckt, als Hintergrundbild für eine GUI nutzen, finde allerdings keine Lösung.
Hab es bereits mit GDIPLUS versucht (da konnte ich keine dll benutzen) und mit dem Beispiel der schwebende Buttons sehe ich mein Bild leider auch nicht oder nicht transparent.
Spoiler anzeigen
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <WinAPI.au3>
$gui = GUICreate("Test Windows regions", 256, 256, -1, -1, $WS_POPUP, $WS_EX_TOPMOST)
$pic = GUICtrlCreateIcon("resource.dll", 5,0,0,256,256)
GUISetState(@SW_SHOW)
$pos = WinGetPos($gui)
_GuiHole($gui, 0, 0, 150, 150)
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_SECONDARYUP
ExitLoop
EndSwitch
WEnd
Func _GuiHole($h_win, $i_x, $i_y, $i_sizew, $i_sizeh)
Local $outer_rgn, $inner_rgn, $combined_rgn
$combined_rgn = _WinAPI_CreateRectRgn(0, 0, 0, 0)
_WinAPI_DeleteObject($outer_rgn)
_WinAPI_DeleteObject($inner_rgn)
_AddCtrlRegion($combined_rgn, $pic)
_WinAPI_SetWindowRgn($h_win, $combined_rgn)
EndFunc ;==>_GuiHole
Func _AddCtrlRegion($full_rgn, $ctrl_id)
Local $ctrl_pos, $ctrl_rgn
If IsArray($ctrl_id) Then
For $i = 0 To UBound($ctrl_id) -1
$ctrl_pos = ControlGetPos($gui, "", $ctrl_id[$i])
$ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0], $ctrl_pos[1], $ctrl_pos[0] + $ctrl_pos[2], $ctrl_pos[1] + $ctrl_pos[3])
_WinAPI_CombineRgn($full_rgn, $full_rgn, $ctrl_rgn, $RGN_OR)
_WinAPI_DeleteObject($ctrl_rgn)
Next
Else
$ctrl_pos = ControlGetPos($gui, "", $ctrl_id)
$ctrl_rgn = _WinAPI_CreateRectRgn($ctrl_pos[0], $ctrl_pos[1], $ctrl_pos[0] + $ctrl_pos[2], $ctrl_pos[1] + $ctrl_pos[3])
_WinAPI_CombineRgn($full_rgn, $full_rgn, $ctrl_rgn, $RGN_OR)
_WinAPI_DeleteObject($ctrl_rgn)
EndIf
EndFunc ;==>_AddCtrlRegion
Ich hoffe ihr könnt mir ein wenig auf die Sprünge helfen,
Gruß Gremlin