在wxPython的窗口中显示.png图像 [英] Showing a .png image in a window in wxPython

查看:535
本文介绍了在wxPython的窗口中显示.png图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在wxPython的窗口中显示.png图像?

How to show a .png image in a window in wxPython?

推荐答案

png = wx.Image(imageFile, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
wx.StaticBitmap(self, -1, png, (10, 5), (png.GetWidth(), png.GetHeight()))

更长的示例: http://web.archive.org/web/20090823114922/http://www.daniweb.com/code/snippet337.html

这篇关于在wxPython的窗口中显示.png图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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