Hallo zusammen,
ich habe die Forumssuche benutzt und auch etliche hilfreiche Threads gefunden. Jedoch keinen, der mir bei meinem Problem zur Lösung geholfen hätte.
Im Anhang habe ich drei Bilder, und einen Beispiel Quellcode.
Es geht im Moment bloss ums Prinzip!
Das eine Bild musste ich aus Lizenzgründen etwas "übermalen", damit man nicht alles sieht.
Folgendes möchte ich:
Das Bild (24852.gif) soll auf der anderen GUI dargestellt werden. Und zwar transparent!
Aber das kriege ich nicht hin. Ich weiss, dass vom letzten Bild das oberste linke Pixel die transparente Farbe angibt.
Deshalb extra die GUI2.gif, welche vollflächig aus "Transparenz" besteht, damit diese "Farbe" unsichtbar ist.
Am besten ihr führt das Script einfach mal aus, dann seht ihr, was ich meine.
Wie kriege ich die Transparenz hin?
Spoiler anzeigen
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;~ FileInstall("GUI.gif", "GUI.gif", 1)
;Create fullscreen background
GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x000000)
GUISetState()
;Create Layered GUI
GUICreate("",989,768,-1,-1,$WS_POPUP,$WS_EX_LAYERED) ;Layered GUI
GUICtrlCreatePic("GUI.gif",0,0,989,768)
;~ GUICtrlSetState(-1,$GUI_DISABLE) ;Disable GUI when you want to have the possibility to drag it by the "WS_EX_PARENTDRAG" used in a Label or picture!
;Create "Progress bar". Use Label with special character to show a pleasing progress bar
$Label = GUICtrlCreateLabel(ChrW(9608),225,112,715,8)
GUICtrlSetBkColor($Label,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Label, 1, 400, 0, "Fixedsys")
GUICtrlSetColor($Label, 0xFF0000)
;Create picture
GUICtrlCreatePic("24852.gif", 150, 230, 800, 515, -1, $WS_EX_TRANSPARENT)
GUICtrlSetBkColor(-1,$GUI_BKCOLOR_TRANSPARENT)
;Create empty picture for setting the transparent color. Because the last picture defines the transparent pixel (top-left pixel = transparent color)
GUICtrlCreatePic("GUI2.gif", 0, 0, 989, 768)
GUISetState (@SW_SHOW) ; will display an empty dialog box
While 1
$Progress = GUICtrlRead($Label)
GUICtrlSetData($Label, $Progress & ChrW(9608))
If StringLen($Progress) > 87 Then
Sleep(2000)
ExitLoop
EndIf
Sleep(100)
WEnd
Grüsse
Veronesi