Share

wxWidgets

Tracker: Bugs

5 png under windows 98/2000 turn black - ID: 1816085
Last Update: Settings changed ( neis )

Png shown by wxStaticBitmap will have the transparent parts turn black if
any pixel in the png has an alpha value that is not 0 or 255. If all the
pixels have 0 or 255, the transparency works fine. The workaround is to go
into photoshop an insure that all the png files are free of pixels that
have in between alpha values.


maxinuruguay ( maxinuruguay ) - 2007-10-18 19:15

5

Closed

Fixed

Nobody/Anonymous

wxMSW specific

None

Public


Comments ( 4 )

Date: 2008-05-01 22:06
Sender: moonkid


Please close the bug.
My last comment has nothing to do with this bug.


Date: 2008-04-28 16:57
Sender: moonkid


The bug is still there on WinXPSP2 with wxStaticBitmap and wxTreeCtrl
items, etc.

Please see this picture
<ftp://ftp.berlios.de/pub/blackfisk/logo_alpha.png>

In the background is a big blackfisk. That is the SVG-Version I created
with "Inkscape". The background is set to transparent (Inkscape display it
white).

In the right-top-corner you can see the exported PNG-file with the
transparent background (pink is transparent here because I setup the
viewing software that way). Each other SVG-viewing software (e.g. Opera)
display it correct with a transparent background.

Then I try to use the exported PNG as a icon in a wxStaticText and
"import" with this line.
wxwidgets:
wxBitmap(wxString::Format(_T("%s%s"), BF_GRAPHICDIR, _T("logo128.png")),
wxBITMAP_TYPE_PNG));

You can see the result in the right-middle in the picture. You see the
black background? Something is wrong here.

My workaround is to load the PNG-file in IrfanView (a picture-viewer on
Win32) and re-save it with setting the transparent colour explicite in the
saving-options.
Then it looks like the right-bottom picture.

What is wrong here in this chain? I am not sure but I think wx did
something different or wrong while loading a PNG then other PNG-viewers
does.
And I can say that storing transparency is handled different between
Inkscape and IrfanView.
________________
wxWdigets 2.9.x (SVN) build with MinGW as debug-dll on WinXPSP2
Code::Blocks as IDE


Date: 2007-12-07 08:49
Sender: g00fy


I fixed this bug:
https://sourceforge.net/tracker/index.php?func=detail&aid=1761598&group_id=9863&atid=309863


Date: 2007-12-07 08:46
Sender: andreadestefani


Thanks to maxinuruguay for submit this bug.

I want only to "update" this track and confirm what maxinuruguay have
already said. The problem with PNG alpha is present in win98/2000, not in
XP/Vista (don't know about MacOS and linux); the problem is present only
when use wxStaticBitmap (PNGs loaded in wxToolBar, or in wxMenu by
Menuitem->SetBitmap, or in wxListCtrl, works fine!).

Thanks to all wxDevs.



Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2008-05-11 18:15 neis
resolution_id None 2008-05-11 18:15 neis
close_date - 2008-05-11 18:15 neis