透明窗口背景(Python Tkinter) [英] Transparent Window Background (Python Tkinter)

查看:595
本文介绍了透明窗口背景(Python Tkinter)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要的是一个透明的tkinter窗口,
但是没有显示在此窗口上的图像.

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

我看过

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.

反正是在Python中可以做到这一点吗?

Are there anyways to do this in Python?

(规格:
Python 2.7.1
Tkinter
PhotoImage
Windows7)

(specs:
Python 2.7.1
Tkinter
PhotoImage
Windows7)

推荐答案

我建议另一个ui库

我刚刚了解到pygame不支持窗口透明,但是根据最近的帖子此处如果可以的话,wxPython会这样做

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

更多链接:
通过桌面在Windows下绘制(我认为您可以适应) 关于各种实现方式

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

这篇关于透明窗口背景(Python Tkinter)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆