多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
程序启动时出现一个启动画面,先看代码: ~~~ class PaintApp(wx.App): def OnInit(self): bmp = wx.Image("P7080079.JPG").ConvertToBitmap() wx.SplashScreen(bmp, wx.SPLASH_CENTER_ON_SCREEN | wx.SPLASH_TIMEOUT, , None, -1) wx.Yield() frame = PaintFrame(None) frame.Show(True) self.SetTopWindow(frame) return True if __name__ == '__main__': app = PaintApp() app.MainLoop() ~~~ 测试一下,使用一张自己前几天拍的荷花。 ![](https://box.kancloud.cn/2016-06-08_5757936138447.png) 知识点: 原型: wxSplashScreen(const [wxBitmap](http://www.cnblogs.com/dyx1024/admin/)& bitmap, long splashStyle, int milliseconds, [wxWindow](http://www.cnblogs.com/dyx1024/admin/)*parent, wxWindowID id, const [wxPoint](http://www.cnblogs.com/dyx1024/admin/)& pos = wxDefaultPosition, const [wxSize](http://www.cnblogs.com/dyx1024/admin/)& size = wxDefaultSize, long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP) splashStyle is a bitlist of some of the following: - wxSPLASH_CENTRE_ON_PARENT - wxSPLASH_CENTRE_ON_SCREEN - wxSPLASH_NO_CENTRE - wxSPLASH_TIMEOUT - wxSPLASH_NO_TIMEOUT milliseconds is the timeout in milliseconds. 方法: - wxSplashScreen::OnCloseWindow - wxSplashScreen::GetSplashStyle - wxSplashScreen::GetSplashWindow - wxSplashScreen::GetTimeout