Transparent Window Background (Python Tkinter)
Asked Answered
S

1

2

What I need is a tkinter window that is transparent,
but with a image displayed on this window is not.

I've seen the

w.attributes('-alpha', 0.1)

thing, but that makes the image transparent as well.

I need just the background of the window transparent,
so that an image on the window that has transparent parts,
will show the Users desktop through these parts.

Are there anyways to do this in Python?

(specs:
Python 2.7.1
Tkinter
PhotoImage
Windows7)

Snag answered 26/7, 2011 at 2:5 Comment(0)
D
1

I would suggest another ui library

pretty much a duplicate to Is it possible to create a Tkinter Window with no frame, and no background?

I just learnt that pygame don't support window transparency but according to the last post here wxPython does if that's an option

more links:
draws under windows over desktop(you can adapt I think) Discussion about various ways to implement

Did answered 26/7, 2011 at 5:45 Comment(5)
@james might be pygtk, pyqt, pygame or something like that, I think what you want is something along with pygame fullscreen and transparency, and then paint over itDid
That might be helpful to someone with this problem. Maybe you could put that in your answer with links to find more information?Ardellaardelle
Aww, that sucks. At least there is a solution though, even if inconveniant. Thanks!Snag
@Anti Earth sorry there isn't a easier way :( When i first switched from Tkinter was when I had to use pyGTK and I hated the idea of that you needed to connec, but now I don't know why I did. It really was simple. Good luck!Did
WXpython does indeed work well for transparent windows, however, at least in my distribution of it the transparent sections of the frame come up white about 1 in 5 times.Progressionist

© 2022 - 2024 — McMap. All rights reserved.