[wxPython] icon masking

Hi,

I've put some icons in my program. They had ugly borders so I looked into the
docs on how to mask them. There docs talk about a few api calls which didn't
exist, but I was finally able to get it to work with the following sequence.
I'm just wondering, is there a better, or faster way to do this?

self.imglist = wxImageList(16, 16)
bmp = wxBitmap('bitmaps/reqicon.bmp', wxBITMAP_TYPE_BMP)
bmp.SetMask( wxMaskColour(bmp, wxColour(0,255,0)) )
self.reqicon = self.imglist.Add(bmp)

···

--
-Mike

I've put some icons in my program. They had ugly borders so I looked into

the

docs on how to mask them. There docs talk about a few api calls which

didn't

exist, but I was finally able to get it to work with the following

sequence.

I'm just wondering, is there a better, or faster way to do this?

self.imglist = wxImageList(16, 16)
bmp = wxBitmap('bitmaps/reqicon.bmp', wxBITMAP_TYPE_BMP)
bmp.SetMask( wxMaskColour(bmp, wxColour(0,255,0)) )
self.reqicon = self.imglist.Add(bmp)

That's how I usually do it. If you use an image format that has the mask or
background colour built in then wxBitmap and wxImage should recognise that
and you won't have to explicily set the mask yourself.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxpython.org Java give you jitters?
http://wxpros.com Relax with wxPython!