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:
@@ -740,8 +740,19 @@ bool wxCreateGreyedImage(const wxImage& in, wxImage& out)
|
|||||||
{
|
{
|
||||||
out = in.Copy();
|
out = in.Copy();
|
||||||
|
|
||||||
// assuming the pixels along the edges are of the background color
|
unsigned char r, g, b;
|
||||||
wxColour bgCol(in.GetRed(0, 0), in.GetGreen(0, 0), in.GetBlue(0, 0));
|
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 darkCol = wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW) ;
|
||||||
wxColour lightCol = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT) ;
|
wxColour lightCol = wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT) ;
|
||||||
|
Reference in New Issue
Block a user