Hey Leute,
ich bräuchte mal wieder eure Hilfe, unzwar habe ich eine GUI die ist aber als WS_POPUP. Der habe ich per GDI+ einen Hintergrund (.png) gegeben, nun möcht die Controls transparent haben, so das ich nicht diese grauen Flächen dortdrum habe.
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <GDIPlus.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Global Const $AC_SRC_ALPHA = 1
Global $pngSrcSettingsBK = "config.png"
HotKeySet("{ESC}", "_Exit")
[/autoit] [autoit][/autoit] [autoit]$Config_GUI = GUICreate("Einstellungen", 600, 450, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
_GDIPlus_Startup()
$hImageSettingsBK = _GDIPlus_ImageLoadFromFile($pngSrcSettingsBK)
_SetBitmap($Config_GUI,$hImageSettingsBK, 255)
GUICtrlCreateButton("OK", 20, 200, 110, 30)
GUICtrlCreateRadio("Test", 20, 250, 100, 20)
GUISetState(@SW_SHOW)
While 1
Sleep(100)
WEnd
Func _Exit()
Exit
EndFunc
Func _SetBitmap($hGUI, $hImageBK, $iOpacity)
Local $hScrDC, $hMemDC, $hBitmap, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend
$hScrDC = _WinAPI_GetDC(0)
$hMemDC = _WinAPI_CreateCompatibleDC($hScrDC)
$hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImageBK)
$hOld = _WinAPI_SelectObject($hMemDC, $hBitmap)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", _GDIPlus_ImageGetWidth($hImageBK))
DllStructSetData($tSize, "Y", _GDIPlus_ImageGetHeight($hImageBK))
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", $iOpacity)
DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA)
_WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA)
_WinAPI_ReleaseDC(0, $hScrDC)
_WinAPI_SelectObject($hMemDC, $hOld)
_WinAPI_DeleteObject($hBitmap)
_WinAPI_DeleteDC($hMemDC)
EndFunc ;==>SetBitmap
PNG ist im Anhang.