wxBitmap and Mask problem

Hi All,

I am using wxStaticBitmap, to load three images by condition
I want the image(s) background to be TRANSPARENT in the wxStaticBitmap.

So, I used wxMaskColour to filter background color of the bitmaps.

Everything works for the first bitmap I used in wxStaticBitmap. But other
two bitmaps are not
displaying at all after using wxStaticBitmap::SetBitmap.

here is my code

        self.bmpoff = wxBitmap("off.bmp",wxBITMAP_TYPE_BMP)
        self.bmpon1 = wxBitmap("on1.bmp",wxBITMAP_TYPE_BMP)
        self.bmpon2 = wxBitmap("on2.bmp",wxBITMAP_TYPE_BMP)
        x = wxMaskColour(self.bmpon1,wxWHITE)
        y = wxMaskColour(self.bmpon2,wxWHITE)
        z = wxMaskColour(self.bmpoff,wxWHITE)
        self.bmpon1.SetMask(x)
        self.bmpon2.SetMask(y)
        self.bmpoff.SetMask(z)

        self.ind = wxStaticBitmap(self,-1,self.bmpoff)

.... OnTest(self):
            if self.counter%10 == 0:
                self.ind.SetBitmap(self.bmpon1)
            else:
                self.ind.SetBitmap(self.bmpon2)
            self.counter += 1

All those bitmaps are WHITE background color

What am I doing wrong?

Thanks
Anbu

I am using wxStaticBitmap, to load three images by condition
I want the image(s) background to be TRANSPARENT in the wxStaticBitmap.

So, I used wxMaskColour to filter background color of the bitmaps.

Everything works for the first bitmap I used in wxStaticBitmap. But other
two bitmaps are not
displaying at all after using wxStaticBitmap::SetBitmap.

Please enter a bug about this in the bug tracker. I see some differences in
the C++ code for how the image is handled in the constructor and SetImage
(called by SetBitmap) but I don't understand enough what it is trying to do
to try and fix it.

For now a possible workaround is to create three wxStaticBitmaps and
Show(false) the ones you don't want displayed.

···

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