Fix handling of bitmaps with alpha channel in wxMSW wxImageList.

Don't use mask and alpha together, this results in visual artefacts and masks
are unnecessary with RGBA bitmaps anyhow.

The only potentially problematic remaining case is mixing bitmaps with alpha
and mask inside the same image list (as we need to indicate whether we use the
mask or not when creating it), but this should probably be rare and in the
meanwhile we can at least RGBA bitmaps with image lists, which includes doing
this implicitly when they are used as button bitmaps.

Also refactor wxBitmap code to extract part of CopyFromIconOrCursor() to allow
reusing it in the newly added MSWUpdateAlpha().

See #11476.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-01-07 21:13:20 +00:00
parent 739ccedee7
commit 44f26d6f82
4 changed files with 117 additions and 62 deletions

View File

@@ -180,6 +180,10 @@ public:
// implementation only from now on
// -------------------------------
// Set alpha flag to true if this is a 32bpp bitmap which has any non-0
// values in its alpha channel.
void MSWUpdateAlpha();
public:
void SetHBITMAP(WXHBITMAP bmp) { SetHandle((WXHANDLE)bmp); }
WXHBITMAP GetHBITMAP() const { return (WXHBITMAP)GetHandle(); }