I have a staticbitmap that load a png image with transparency.
On win xp I see my frame with the bitmaps with transparency, but
on win2k no. I see an horrible black background.
Is this a my problem?
This is a piece of code:
bmp_succ = wx.StaticBitmap(bitmap=wx.Bitmap(u'imgs/next.png',
wx.BITMAP_TYPE_PNG), id=-1, name=u'bmp_succ', parent=self,
pos=wx.Point(360, 232), size=wx.Size(16, 16), style=0)
I have a staticbitmap that load a png image with transparency.
On win xp I see my frame with the bitmaps with transparency, but
on win2k no. I see an horrible black background.
Older versions of the native widgets do not support alpha transparency, only masks (1-bit alpha). Try loading the png file into a wx.Image first, then call it's ConvertAlphaToMask method and then convert it to a bitmap for the widget.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
I have a staticbitmap that load a png image with transparency.
On win xp I see my frame with the bitmaps with transparency, but
on win2k no. I see an horrible black background.
Older versions of the native widgets do not support alpha transparency, only masks (1-bit alpha). Try loading the png file into a wx.Image first, then call it's ConvertAlphaToMask method and then convert it to a bitmap for the widget.
Wow, fantastic, it work!
But when you say "older version of native widgets", what you intend? the
win2k widgets (so also win9x) or wxpython widgets? Because I'm using wx 2.5.3 on both machines.
it is about the Windows controls (widgets) that are beneath wxwidgets(wxpython).
You can observe the same thing on XP if you pack the python app into an EXE with py2exe and you don't provide the manifest.
This has nothing to do with the wxpython version you're using but with the version of the common controls you're using.
···
On Wed, 16 Mar 2005 09:51:21 +0200, Michele Petrazzo <michele.petrazzo@unipex.it> wrote:
Robin Dunn wrote:
Michele Petrazzo wrote:
I have a staticbitmap that load a png image with transparency.
On win xp I see my frame with the bitmaps with transparency, but
on win2k no. I see an horrible black background.
Older versions of the native widgets do not support alpha transparency, only masks (1-bit alpha). Try loading the png file into a wx.Image first, then call it's ConvertAlphaToMask method and then convert it to a bitmap for the widget.
Wow, fantastic, it work!
But when you say "older version of native widgets", what you intend? the
win2k widgets (so also win9x) or wxpython widgets? Because I'm using wx 2.5.3 on both machines.
I have a staticbitmap that load a png image with transparency.
On win xp I see my frame with the bitmaps with transparency, but
on win2k no. I see an horrible black background.
Older versions of the native widgets do not support alpha transparency, only masks (1-bit alpha). Try loading the png file into a wx.Image first, then call it's ConvertAlphaToMask method and then convert it to a bitmap for the widget.
Wow, fantastic, it work!
But when you say "older version of native widgets", what you intend? the
win2k widgets (so also win9x) or wxpython widgets? Because I'm using wx 2.5.3 on both machines.
The win2k widgets. (When I say "native" it means whatever is supplied by the platform.)
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!