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

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

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

05 Apr 2020, 12:00

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!
Attachments
TransparentGui1.PNG
TransparentGui1.PNG (34.15 KiB) Viewed 5687 times
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

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

05 Apr 2020, 12:31

is your gui image just a simple shape like the example you posted?
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

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

05 Apr 2020, 12:48

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 5661 times
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

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

05 Apr 2020, 13:20

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!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
Hellbent
Posts: 2109
Joined: 23 Sep 2017, 13:34

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

05 Apr 2020, 13:36

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 ;)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: CrowexBR, doodles333, vysmaty and 245 guests