Loading an exe icon into a pixmap/bitmap

kyosohma at gmail.com kyosohma at gmail.com
Wed Dec 12 09:14:12 EST 2007


On Dec 12, 12:09 am, ob.l... at gmail.com wrote:
> I've been searching for a way to load an icon from an executable into
> something that I can eventually display either through pygame or
> pygtk. I've tried the stuff found athttp://groups.google.com/group/comp.lang.python/browse_thread/thread/...
> but the tests just output all black (not surprising, as that guy
> couldn't get it to work either). I've mucked around with taht code and
> the ExtractIcon stuff from pywin32, but still am stuck. I've seen some
> reference to a wxpython ways to do it, but I'm trying to not have to
> convert over to that. Any help is appreciated. Thanks

wxPython uses an included tool called img2py. The source looks pretty
straight-forward. You may be able to modify it or re-create it using
your GUI toolkit of choice.

If you install wxPython, you'll find it (approx.) here:

C:\Python24\Lib\site-packages\wx-2.8-msw-unicode\wx\tools

Mike



More information about the Python-list mailing list