Page 1 of 1

[Gui] 100% Transparent background and 50% transparent picture

Posted: 05 Apr 2020, 12:00
by Scr1pter
Hello,

I created an Image which has transparent background.
It gets shown in a GUI and only the image is visible, which is correct (no grey background).

Is it also possible that this image is like 50% transparent?
Gui background should still be 100% transparent.

Code: Select all

F1::
Gui, Tr: Color, feffff ; Color which should be removed later
Gui, Tr: +LastFound +AlwaysOnTop -Caption +ToolWindow +E0x20 ; ..., ..., No title, no icon, user can click through it
Gui, Tr: Add, Picture, x0 y0 w1280 h1024, Transparentes Bild.png ; An image which has transparent background
Gui, Tr: Show, x0 y0 w1280 h1024 NA, GuiTransparent ; Shows gui with unique name, without activating it
WinSet, TransColor, feffff ; Removes specified color
return
Attached how it is and I how it should be.

P.S. The blue color hexcode is 3359CB according to Window Spy.

Thanks for any help and best regards!

Re: [Gui] 100% Transparent background and 50% transparent picture

Posted: 05 Apr 2020, 12:31
by Hellbent
is your gui image just a simple shape like the example you posted?

Re: [Gui] 100% Transparent background and 50% transparent picture  Topic is solved

Posted: 05 Apr 2020, 12:48
by Hellbent

Code: Select all

#SingleInstance, Force
SetBatchLines, -1

Gui,+AlwaysOnTop +LastFound -Caption +E0x20
Gui,Color,FFFFFF
WinSet,Transcolor, FFFFFF 126
Gui,Margin,0,0
Gui,Add,Pic,x0 y0,C:\Users\Hellbent\Desktop\AHK Tools\Color Picker Mini\Screen Shots\20200405134002.png
Gui,Show,

return
GuiClose:
GuiContextMenu:
*ESC::ExitApp

temp gif.gif
temp gif.gif (160.23 KiB) Viewed 476 times

Re: [Gui] 100% Transparent background and 50% transparent picture

Posted: 05 Apr 2020, 13:20
by Scr1pter
Thank you, Hellbent!
I believe I tried that, but probably I made some mistake.
Basically changing
WinSet, TransColor, feffff
to
WinSet, TransColor, feffff 126
already did the job.
The rest remained the same.


P.S. 2 more posts... ;)

Cheers!

Re: [Gui] 100% Transparent background and 50% transparent picture

Posted: 05 Apr 2020, 13:36
by Hellbent
Scr1pter wrote:
05 Apr 2020, 13:20
Thank you, Hellbent!
No problem.

For better results, you may want to look at using a layered window. Winset, Transcolor can cause some issues with gradient antialiased edges on rounded corners. Anyway, just something to consider.

1 More ;)