Ich glaube, die Überschrift sagt schon alles: Wie mache ich eine GUI 100% durchsichtig, aber das Bild nicht?
Fenster 100% Transparent, Bild aber nicht
-
- [ offen ]
-
MasterOfTime -
5. Januar 2010 um 16:24 -
Geschlossen -
Erledigt
-
-
Ich glaube, die Überschrift sagt schon alles
hm man müsste immer noch raten^^
willst du das nur das bild angezeigt wird und sonst nichts?
-
So ungefähr:
Spoiler anzeigen
[autoit]#include <WindowsConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
$hGUI = GUICreate("test",600,400,-1,-1)
WinSetTrans($hGUI,"",0)
GUISetState(@SW_SHOW,$hGUI)$hChild = Guicreate("test",200,200,100,100,$WS_POPUP,$WS_EX_MDICHILD,$hGUI)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
;Child GUI erstellen, auf dem das Pic liegt. das Child gui wird nicht unsichtbar gemacht.
GUICtrlCreateButton("Mega Button",0,0,200,200)
GUISetState(@SW_SHOW,$hChild)While 1
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
EndSwitch
WEndOder hier eine Version mit unnötig viel Spielerei:
Spoiler anzeigen
[autoit]#include <WindowsConstants.au3>
[/autoit] [autoit][/autoit] [autoit]
$hGUI = GUICreate("test",600,400,-1,-1)
WinSetTrans($hGUI,"",0)
GUISetState(@SW_SHOW,$hGUI)$hChild = Guicreate("test",200,200,100,100,$WS_POPUP,$WS_EX_MDICHILD,$hGUI)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
;Child GUI erstellen, auf dem das Pic liegt. das Child gui wird nicht unsichtbar gemacht.
$Button = GUICtrlCreateButton("Mega Button",0,0,200,200)
GUISetState(@SW_SHOW,$hChild)While 1
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $Button
For $i = 255 to 0 Step -5
WinSetTrans($hChild,"",$i)
Sleep(10)
Next
Sleep(500)
For $i = 0 to 255 Step 5
WinSetTrans($hChild,"",$i)
WinSetTrans($hGUI,"",$i)
Sleep(10)
Next
Sleep(500)
For $i = 255 to 0 Step -5
WinSetTrans($hGUI,"",$i)
Sleep(10)
Next
Sleep(500)
EndSwitch
WEnd -
ich möchte, dass alles durchsichtig wird.
Nur das Bild soll noch zu sehen sein. -
Dann probier doch SEuBo's Code mal aus!
edit: Grade die Erstellungszeiten verglichen -
SEuBo:
Danke das klappt.
Haben so gut wie Zeitgleich erstellt, da konnte ich seinen Code noch nicht sehen -
Danke das klappt.
Schön, wenn ich helfen konnte
-
Aber wenn ich nun dein Code nehme, bleibt immernoch ein weißes Felb um das Bild.
Ich habe den Button durch das Bild ersetzt, und auch beide Codes getestet.
Kann man das auch irdengwie so machen, das man dieses weiße Feld nicht sieht? -
das bild in der gui muss genausogroß wie die komplette gui und bei 0, 0 beginnen.
$hChild = Guicreate("test",200,200,100,100,$WS_POPUP,$WS_EX_MDICHILD,$hGUI)
GUICtrlCreatePic($pfad,0,0,200,200)
-
Danke.
Jetz muss ich nurnoch wissen, wie ich das Bild verschieben kann ;D -
Da konnte ich auch was lernen (ist immer eindrucksvoll etwas ganz ohne Gui anzeigen zu lassen )
Danke @Allmfg Ubuntu
-
Dafür is das Forum doch da, um was zu lernen...
Möchte jetz auch noch wissen, wie man das Bild verschieben kann -
[autoit]
[/autoit]
ControlMove()mfg Ubuntu
-
Zitat[autoit]
ControlMove()
[/autoit]das würde nur das control bewegen, ich glaub eher dass du winmove suchst.
oder noch besser:
es gibt auch nen style für guicreate. dann kann man das bild (oder bessergesagt die ganze gui mit dem bild) mithilfe der maus verschieben.
einziges problem: mir fällt der style nicht ein -
so gehts auch sehr einfach
Spoiler anzeigen
[autoit]#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <WindowsConstants.au3>$hgui = Guicreate("test",200,200,-1,-1,$WS_POPUP)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlCreateLabel("", 0, 0, 200, 200, Default, $GUI_WS_EX_PARENTDRAG) ;verschieben des Fensters möglich machen durch ""2. Fenster"
GUICtrlCreatePic(@SystemDir & "\oobe\images\mslogo.jpg", 0, 0, 200, 200)
GUISetState()do
[/autoit] [autoit][/autoit] [autoit][/autoit]
until guigetmsg()=-3 -
- Offizieller Beitrag
Andy: Das Leerlabel braucht man mittlerweile nicht mehr:
ZitatYou can enable window draging for GUI without $WS_CAPTION by using $WS_EX_CONTROLPARENT in the exStyle parameter.
-
Ich bedanke mich auch mal für diese Frage und für die Antworten
Das habe ich auch gesucht =) -
Andy: Das Leerlabel braucht man mittlerweile nicht mehr:
Man bruacht es zwar nicht mehr, aber wenn zB das Bild per GUISetState(-1,$GUI_DISABLE) deaktiviert wird (zB damit man noch andere Controls benutzen kann), funktinioniert Parentdrag nicht mehr. Das Leerlable kann in diesem Fall helfen.
-
$GUI = GUICreate("",600, 440,-1,-1,$WS_POPUP,$WS_EX_LAYERED)
$pic = GUICtrlCreatePic("",0,0,600,440)
GUICtrlSetState(-1,$GUI_DISABLE)So sollte es doch auch gehen oder?
MfG
-
- Offizieller Beitrag
Also bei mir funktioniert das hier (mal abgesehen davon, dass es das Bild unter Win7 nicht mehr gibt):
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>$hgui = GUICreate("test", 200, 200, -1, -1, $WS_POPUP, $WS_EX_CONTROLPARENT)
[/autoit] [autoit][/autoit] [autoit]
;~ GUICtrlCreateLabel("", 0, 0, 200, 200, Default, $GUI_WS_EX_PARENTDRAG) ;verschieben des Fensters möglich machen durch ""2. Fenster"
GUICtrlCreatePic(@SystemDir & "\oobe\images\mslogo.jpg", 0, 0, 200, 200)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState()Do
[/autoit]
Until GUIGetMsg() = -3