Jump to content
Sign in to follow this  
nyke0

GUI - Transparent with GUICtrlCreatePic ???

Recommended Posts

nyke0

My GUI become blue instead of full transparency while I use GUICtrlCreatePic. :/
Is it possible to use GUICtrlCreatePic with a transparency background?
 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <WinAPI.au3>

$Form1 = GUICreate("Form1", 200, 135, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
GUISetBkColor(0xABCDEF)
_WinAPI_SetLayeredWindowAttributes($Form1, 0xABCDEF, 255)
$Button = GUICtrlCreateButton("Button", 10, 10, 75, 25, $WS_GROUP)
GUICtrlCreatePic(@ScriptDir & '\testimg.jpg', 10, 40, 162, 49)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Button
            Exit

    EndSwitch
WEnd

post-87183-0-83522700-1409725072.jpg

Share this post


Link to post
Share on other sites
UEZ

The order of the commands is important:
 

$Form1 = GUICreate("Form1", 200, 135, -1, -1, $WS_POPUP, $WS_EX_LAYERED)
GUISetBkColor(0xABCDEF)
$Button = GUICtrlCreateButton("Button", 10, 10, 75, 25, $WS_GROUP)
GUICtrlCreatePic(@ScriptDir & '\testimg.jpg', 10, 40, 120, 60)
_WinAPI_SetLayeredWindowAttributes($Form1, 0xABCDEF, 255)
GUISetState(@SW_SHOW)

Br,

UEZ

  • Like 1

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×