Problem with adding img2py'ed ico file to wx.ImageList

Vincent Wehren wrote:

Hi Robin,

Oddly, bmp.Ok() returns True.

However,

assert wx.Bitmap("settings.ico"
                , type=wx.BITMAP_TYPE_ICO) == icons.getSettingsBitmap()

raises an 'AssertionError'.

wx.Bitmap's __eq__ method only checks if they are the same instance, not if the images look the same (IOW, have the same image data.)

(icons.py freshly generated, no old *.pyc or something lying about)

Just to make sure, I tried without compression (-u), but that didn't matter.
I've tried saving the icons as BMP's and img2py'ing that. Than it seems to work
just fine, however they no longer have transparent backgrounds then (maybe that can be helped?).

The BMP format doesn't have transparency support. You can try converting to PNG instead, or specify which colour should be treated as transparent when you do the img2py.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!