Please make a runnable, small as possible, sample application that
demonstrates the problem, include one of the images that is giving you
trouble, and let us know the platform and wx version.
http://wiki.wxpython.org/MakingSampleApps
--
Robin Dunn
Software Craftsman
http://wxPython.org
You didn't read #7 at http://wiki.wxpython.org/MakingSampleApps very
well, did you? ;-)
> but I believe any portrait image will fail.
Apparently PIL's thumbnail method is going to maintain the aspect ratio
in at least some cases, and so you can end up with an image that is not
(50,50). One of my testcases made a thumbnail that was (37,50).
wx.ImageList requires that all the icons it holds are the same size.
BTW, you can also use wx.Image instead of PIL for simple image
manipulations like this, and wx.Image.Scale will always give you an
image of the specified size.
You didn't read #7 at http://wiki.wxpython.org/MakingSampleApps very
well, did you? ;-)
Apparently PIL's thumbnail method is going to maintain the aspect ratio
You could probably start off with a black 50x50 image, then scale your
image within the 50x50 bounding box. Finally overlay the resized image
onto the black image to produce the 50x50 image you need (with black
stripes at top/bottom, right/left).
It seems like (from your description) this happens for landscape
pictures, but not portrait, if you handle this yourself, it will be
done in either case.