[ 1502016 ] wxImage::ConvertToGreyscale should retain alpha channel.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39621 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2006-06-07 17:02:08 +00:00
parent 9061c15cee
commit 7ce30d0b41

View File

@ -866,6 +866,16 @@ wxImage wxImage::ConvertToGreyscale( double lr, double lg, double lb ) const
}
}
// copy the alpha channel, if any
if (HasAlpha())
{
const size_t alphaSize = GetWidth() * GetHeight();
unsigned char *alpha = (unsigned char*)malloc(alphaSize);
memcpy(alpha, GetAlpha(), alphaSize);
image.InitAlpha();
image.SetAlpha(alpha);
}
return image;
}