return true;
}
-bool wxImage::ConvertAlphaToMask(unsigned threshold)
+bool wxImage::ConvertAlphaToMask(unsigned char threshold)
{
if (!HasAlpha())
return true;
wxLogError( _("No unused colour in image being masked.") );
return false;
}
-
+
SetMask(true);
SetMaskColour(mr, mg, mb);
-
+
unsigned char *imgdata = GetData();
unsigned char *alphadata = GetAlpha();
- size_t w = GetWidth();
- size_t h = GetHeight();
+ int w = GetWidth();
+ int h = GetHeight();
- for (size_t y = 0; y < h; y++)
+ for (int y = 0; y < h; y++)
{
- for (size_t x = 0; x < w; x++, imgdata += 3, alphadata++)
+ for (int x = 0; x < w; x++, imgdata += 3, alphadata++)
{
if (*alphadata < threshold)
{
free(M_IMGDATA->m_alpha);
M_IMGDATA->m_alpha = NULL;
+
+ return true;
}
#if wxUSE_PALETTE