Skip to main content
 首页 » 编程设计

python之透明窗口背景(Python Tkinter)

2025年05月04日11softidea

我需要的是一个透明的tkinter窗口,
但是在这个窗口上显示的图像不是。

我看到了

w.attributes('-alpha', 0.1) 

事情,但这也使图像透明。

我只需要透明的窗口背景,
以便窗口上的图像具有透明部分,
将通过这几个部分展示用户桌面。

有没有在 Python 中执行此操作的方法?

(规范:
Python 2.7.1
Tkinter
照片图像
Windows7)

请您参考如下方法:

我会建议另一个 ui 库

几乎与Is it possible to create a Tkinter Window with no frame, and no background? 重复

我刚刚了解到 pygame 不支持窗口透明度,但根据上一篇文章 here如果这是一个选项,wxPython 会做

更多链接:
draws under windows over desktop(you can adapt I think) Discussion about various ways to implement