[ wxwindows-Bugs-1407647 ] Alpha channel is incorrectly converted to mask

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ wxwindows-Bugs-1407647 ] Alpha channel is incorrectly converted to mask

SourceForge.net
Bugs item #1407647, was opened at 2006-01-16 21:22
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1407647&group_id=9863

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: wxImage
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Kristoffer Grönlund (kegie)
Assigned to: Nobody/Anonymous (nobody)
Summary: Alpha channel is incorrectly converted to mask

Initial Comment:
When loading a PNG image with an alpha channel to a
wxBitmap, the alpha information can sometimes be lost
if the wxImage loader converts the alpha channel to a mask.

Workaround is loading it in two steps, setting the
wxImage back to having an alpha channel before passing
it to the wxBitmap constructor.

ie.
wxBitmap bmp("image.png", wxBITMAP_TYPE_PNG); //
sometimes loses alpha channel

//
wxImage img("image.png", wxBITMAP_TYPE_PNG);
if (img.HasMask())
   img.InitAlpha();
wxBitmap bmp(img); // bmp retains alpha channel

This is in 2.6.2.

Since autoconversion alpha->mask ruins the bitmap's use
in transparent toolbar icons, for example, I think it
should be optional (or turned off).

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1407647&group_id=9863

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]