StaticBitmap Question...

Hmm... They both render correctly with the mask here on my XP machine. On Linux and OSX too.

···

andrea.gavana@agip.it wrote:

Hello NG,

      I am working a little bit with a staticbitmap, and I get a question
for you. I attach a sample at the end of the mail. Basically, I construct a
panel with wx.WHITE background, and I put a staticbitmap on it. The bitmap
I use has some transparent regions. In the sample I attach, I use 2
different construction:

1) Construct a wx.StaticBitmap directly from the icon (the Windows
Paste.ico, that I attach also);
2) Construct a wx.ImageList, add the icon to it, get back the Bitmap from
the ImageList and use it in the staticbitmap control.

This 2 constructs give 2 different results. In the first, the Icon is
correctly shown (the transparency is where it should be), while in the
second one the transparent regions have become black... which I don't want.
Moreover, using a black mask to mask the transparent regions is not a
choice, because other regions that are black and should not be masked will
be masked anyway.

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

Hello Robin,

Hmm... They both render correctly with the mask here on my XP machine.

On Linux and OSX too.

Yes, on XP is OK... is on Windows 2000 that I get this strange behavior...

Hello Robin,

Hmm... They both render correctly with the mask here on my XP machine.

On Linux and OSX too.

Sorry, I have misunderstood your answer. You said that they both render
correctly *with the mask*. Yes, because the icon I sent does not have black
pixels inside... so they are not masked by the mask. BUT, if I use an icon
with black pixels inside (like the cut icon on windows, or whatever you
want), then the mask masks also the pixels inside the icon...
Without mask, all the icons have a black background (also on XP).

BTW, how does wxListCtrl use the icons to render them in WHITE background
(or at least transparent)?!? I have a white panel on which I render the
icons, and the background colour of the icons is black, not transparent.

Is there a possible solution to get an ImageList working in this way? Or
do I have to use plain icons in order to make it work?

Thanks for every suggestion.

Andrea.