Ich brauche mal eure Hilfe bei einem GDIPlus-Programm:
Ich möchte, dass die GUI einen transparenten Hintergrund hat, die GDIPlus-Objekte sollen aber voll sichtbar sein. Mit _WinAPI_SetLayeredWindowAttributes() hab' ich's nicht hinbekommen.
Spoiler anzeigen
#include <GDIPlus.au3>
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>
HotKeySet("{ESC}", "_Shut")
Opt("GUIOnEventMode", 1)
$hGui = GUICreate("GDI+", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetOnEvent(-3, "_Shut")
GUISetBkColor(0x000000)
GUISetState()
_GDIPlus_Startup()
Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics(@DesktopWidth, @DesktopHeight, $hGraphics)
Global $Backbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
Global $hPen = _GDIPlus_PenCreate(0xFFFF0000, 2)
_GDIPlus_GraphicsClear($Backbuffer)
Sleep(300)
While 1
$pos = MouseGetPos()
While _IsPressed("01")
$pos2 = MouseGetPos()
_GDIPlus_GraphicsClear($Backbuffer)
_GDIPlus_GraphicsDrawLine($Backbuffer, $pos[0], $pos[1], $pos2[0], $pos[1], $hPen);Oben horizontal
_GDIPlus_GraphicsDrawLine($Backbuffer, $pos[0], $pos[1], $pos[0], $pos2[1], $hPen);Links vertikal
_GDIPlus_GraphicsDrawLine($Backbuffer, $pos2[0], $pos[1], $pos2[0], $pos2[1], $hPen);Rechts vertikal
_GDIPlus_GraphicsDrawLine($Backbuffer, $pos[0], $pos2[1], $pos2[0], $pos2[1], $hPen);Unten horizontal
_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
WEnd
_GDIPlus_GraphicsClear($Backbuffer, 0xFF000000)
Sleep(10)
WEnd
Func _Shut()
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_GraphicsDispose($Backbuffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_PenCreate($hPen)
_GDIPlus_Shutdown()
Exit
EndFunc ;==>_Shut