在wxpython中显示透明的.png
我正在使用Python 2.7。我需要在wxpython中显示一个.png图像文件,这样保留透明度,并且您仍然可以看到图像透明部分后面的控件。这需要在 Windows、Mac 和 Linux 中运行。
I'm using Python 2.7. I need to display a .png image file in wxpython, such that the transparency is preserved, and you can still see the controls behind the transparent part of the image. This needs to work in Windows, Mac, AND Linux.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只是想添加如何正常绘制带有透明度的png,对于那些谷歌并遇到这个问题的人(就像我所做的那样),这样他们最终就不会认为这是不可能的,因为接受的答案(就像我所做的那样)
这就是我的这样做,所有的透明度都完美显示。我正在使用 wxpython 2.9.4.0
I just wanted to add how to draw a png with transparencies normally, for those who google and come across this (as I did) so they dont end up thinking its not possible because of the accepted answer (as I did)
this is what I do, and all the transparencies are displayed perfectly. I'm using wxpython 2.9.4.0
为什么你要把图像放在控件上。我会将控件放在图像的侧面、顶部或下方。最近,wxPython 列表上出现了多个关于 png 和透明度的主题:https: //groups.google.com/forum/#!topic/wxpython-users/ANZGyF0kkZ0
或 https://groups.google.com/forum/#!topic/wxpython-users /_X2zhlTj_Fg
也许其中之一也会对您有所帮助。
Why would you have the image over the controls. I would put the controls to the side, on top or under the image. There have been several threads on pngs and transparency on the wxPython list lately: https://groups.google.com/forum/#!topic/wxpython-users/ANZGyF0kkZ0
or https://groups.google.com/forum/#!topic/wxpython-users/_X2zhlTj_Fg
Maybe one of those will help you too.