Changed wxImage::ConvertAlphaToMask() return type to bool.

Make this function more useful by returning true from it if alpha channel was
really converted to the mask by it.

Closes #12637.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-11-02 11:57:09 +00:00
parent 6f26925422
commit 878f28d8c8
4 changed files with 11 additions and 8 deletions

View File

@@ -2020,7 +2020,7 @@ bool wxImage::SetMaskFromImage(const wxImage& mask,
bool wxImage::ConvertAlphaToMask(unsigned char threshold)
{
if ( !HasAlpha() )
return true;
return false;
unsigned char mr, mg, mb;
if ( !FindFirstUnusedColour(&mr, &mg, &mb) )
@@ -2029,17 +2029,16 @@ bool wxImage::ConvertAlphaToMask(unsigned char threshold)
return false;
}
ConvertAlphaToMask(mr, mg, mb, threshold);
return true;
return ConvertAlphaToMask(mr, mg, mb, threshold);
}
void wxImage::ConvertAlphaToMask(unsigned char mr,
bool wxImage::ConvertAlphaToMask(unsigned char mr,
unsigned char mg,
unsigned char mb,
unsigned char threshold)
{
if ( !HasAlpha() )
return;
return false;
AllocExclusive();
@@ -2070,6 +2069,8 @@ void wxImage::ConvertAlphaToMask(unsigned char mr,
M_IMGDATA->m_alpha = NULL;
M_IMGDATA->m_staticAlpha = false;
return true;
}
// ----------------------------------------------------------------------------