git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43511
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- Fixed version script problems when using configure with cygwin/mingw32.
- Use system default paper size for printing instead of A4
+- Fix colours when converting wxBitmap with alpha to wxImage (nusi)
2.7.2
-----
dst[1] = *src++;
dst[0] = *src++;
- dst += 3;
-
if ( is32bit )
{
if ( alpha )
- *alpha++ = *src;
+ {
+ // wxImage uses non premultiplied alpha so undo
+ // premultiplication done in Create() above
+ const unsigned char a = *src;
+ *alpha++ = a;
+ if ( a > 0 )
+ {
+ dst[0] = (dst[0] * 255 - 127) / a;
+ dst[1] = (dst[1] * 255 - 127) / a;
+ dst[2] = (dst[2] * 255 - 127) / a;
+ }
+ }
+
src++;
}
+
+ dst += 3;
}
// pass to the previous line in the image