I've been trying desperately for the last few hours to get
a colour wxBitmapButton working. It seems so simple:
imgfile = 'arrow_down.jpg'
bmp = wx.Bitmap(imgfile, wx.BITMAP_TYPE_JPEG)
# or alternatively
# bmp = wx.Image(imgfile, wx.BITMAP_TYPE_JPEG).ConvertToBitmap()
b = wx.BitmapButton(self, -1, bmp, (xpos, ypos), (bmp.GetWidth(), bmp.GetHeight()) )
but my buttons thus created don't appear properly. I've put a
screen capture of a test app on:
http://anusf.anu.edu.au/~dee900/Projects/wxPython/
along with two of the source images. I've tried converting
the source images in Photoshop to 8-bit PNG, index-colour,
etc., all to no avail.
Looking at the wxPython wxBitmapButton demo, the
authors use hardcoded XPM images rather than loading from
a file via one of the wx image loaders. Surely one can load from
a file though, no?
Any help is much appreciated.
Cheers,
Darran.
···
--
Darran Edmundson (darran.edmundson@anu.edu.au)
ANU Supercomputer Facility Vizlab
Australian National University, Canberra, ACT 2600
tel: +61 2 6125-0517 fax: +61 2 6125-5088