Transparent Window Background (Python Tkinter)

℡╲_俬逩灬. 提交于 2019-12-11 00:31:04

问题


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)


回答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



来源:https://stackoverflow.com/questions/6824462/transparent-window-background-python-tkinter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!