简体   繁体   English

genbitmaptextbutton在Windows 7上不起作用

[英]genbitmaptextbutton doesn't work on windows 7

I try code from Another Tutorial http://wiki.wxpython.org/AnotherTutorial#Bitmap_Text_Buttons 我尝试使用其他教程中的代码http://wiki.wxpython.org/AnotherTutorial#Bitmap_Text_Buttons

But it doesn't run on wxpython 2.8.12.1 and python 2.6, i've got this errors: 但它无法在wxpython 2.8.12.1和python 2.6上运行,我遇到了以下错误:

File "C:\\Python26\\Lib\\site-packages\\wx-2.8-msw-unicode\\wx_core.py", line 3473 , in ImageFromBitmap val = core .new_ImageFromBitmap(*args, **kwargs) wx._core.PyAssertionError: C++ assertion "bmp.Ok()" failed at ....\\src\\msw\\dib. 文件“ C:\\ Python26 \\ Lib \\ site-packages \\ wx-2.8-msw-unicode \\ wx_core.py”,行3473,位于ImageFromBitmap val = core .new_ImageFromBitmap(* args,** kwargs)wx._core.PyAssertionError: C ++断言“ bmp.Ok()”在.... \\ src \\ msw \\ dib处失败。 cpp(148) in wxDIB::Create(): wxDIB::Create(): invalid bitmap wxDIB :: Create()中的cpp(148):wxDIB :: Create():无效位图

Thx for any help. 感谢任何帮助。

I suspect your bitmaps are not in the correct locations. 我怀疑您的位图不在正确的位置。 Are you providing the "email.png", "calendar.png" and so on images? 您是否提供“ email.png”,“ calendar.png”等图像? If yes, are you sure you are passing their correct path to the wx.Bitmap constructor? 如果是,您确定要将正确的路径传递给wx.Bitmap构造函数吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM