Jump to content

GUI - Transparent with GUICtrlCreatePic ???


nyke0
 Share

Go to solution Solved by UEZ,

Recommended Posts

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

Link to comment
Share on other sites

  • Solution

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

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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...