use image mask colour if any instead of guessing that (0, 0) is always transparent in wxCreateGreyedImage()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2005-03-27 18:00:58 +00:00
parent ec023a6e0b
commit 062b84dd49

View File

@ -740,8 +740,19 @@ bool wxCreateGreyedImage(const wxImage& in, wxImage& out)
{
out = in.Copy();
// assuming the pixels along the edges are of the background color
wxColour bgCol(in.GetRed(0, 0), in.GetGreen(0, 0), in.GetBlue(0, 0));
unsigned char r, g, b;
if ( in.HasMask() )
{
in.GetOrFindMaskColour(&r, &g, &b);
}
else // assuming the pixels along the edges are of the background color
{
r = in.GetRed(0, 0);
g = in.GetGreen(0, 0);
b = in.GetBlue(0, 0);
}
wxColour bgCol(r, g, b);
wxColour darkCol = wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW) ;
wxColour lightCol = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT) ;