Sign in to follow this  
Followers 0
psgarsenal

Transparent image on transparent background?

5 posts in this topic

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

Share this post


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

Share this post


Link to post
Share on other sites

Thanks for the answer!

I've been thinking about it and I think I'll just use multiple guis to do it since I do not need to show text, thanks anyway!

Share this post


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

Share this post


Link to post
Share on other sites

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!

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  
Followers 0