Jump to content

Transparent image on transparent background?


 Share

Go to solution Solved by psgarsenal,

Recommended Posts

Hi everyone!

New here, but saw that a lot of topics are about transparency

I looked in a few but couldn't find a solution to my problem:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
HotKeySet("{ESC}", "Terminate")
Local $sFile = "blank.gif"
$main = GUICreate("dota2utilities", 1680, 1050, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_TOPMOST))
$back = GUICtrlCreatePic($sFile, 0, 0, 1680, 1050,-1)
GUICtrlSetState(-1, $GUI_DISABLE)
$icone = GUICtrlCreatePic("icon-rosh.gif", 0, 0, 46, 16)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
;~ $hDC = GUICtrlCreateLabel("This is text on a transparent Layered GUI",0, 0, 200, 20 )
;~ GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0x000000)
GUISetState(@SW_SHOW)
Do
    $msg = GUIGetMsg()
Until $msg = $GUI_EVENT_CLOSE

Func Terminate()
    Exit 0
EndFunc

The second picture I draw on the screen deletes the transparency on all the screen except inside of it, any solutions?

Thanks for reading!

First picture:

950429blank.gif

Second picture:

879628iconrosh.gif

Link to comment
Share on other sites

You have to use GDIPlus (GDI+) which supports transparency.

There are plenty of examples posted in this forum.

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

No need of multiple guis here. I've to leave in a few minutes but

just load the image with the 3 icons (_GDIPlus_BitmapCreateFromFile),

create an empty bitmap (_GDIPlus_BitmapCreateFromScan0 @ 16x16),

create the image context to the bitmap (_GDIPlus_ImageGetGraphicsContext),

clear it with color 0xFF161616 (_GDIPlus_GraphicsClear),

copy one of the icons using _GDIPlus_GraphicsDrawImageRectRect,

convert the image to GDI bitmap (_GDIPlus_BitmapCreateHBITMAPFromBitmap),

copy that bitmap to the picture control (GUICtrlSendMsg),

cleanup resource when finished.

I will have a look maybe later on it.

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

  • Solution

I didn't meant what I worte, sorry

I will use one gui, because I need only to display one of the pictures at a time, so I just split the pictures into three files that I will read when I will need to change the background

Thanks for your help!

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...