call HasMask() before writing PNG files, as was done in WX_2_0_FIXES

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3686 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Unknown (AN) 1999-09-16 19:24:01 +00:00
parent 9f6af110ff
commit a3daed0276

View File

@ -324,15 +324,16 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos
data[(x << 2) + 0] = *ptr++;
data[(x << 2) + 1] = *ptr++;
data[(x << 2) + 2] = *ptr++;
if ((data[(x << 2) + 0] == image->GetMaskRed()) &&
(data[(x << 2) + 1] == image->GetMaskGreen()) &&
(data[(x << 2) + 2] == image->GetMaskBlue()))
if (( !image->HasMask() ) || \
(data[(x << 2) + 0] != image->GetMaskRed()) || \
(data[(x << 2) + 1] != image->GetMaskGreen()) || \
(data[(x << 2) + 2] != image->GetMaskBlue()))
{
data[(x << 2) + 3] = 0;
data[(x << 2) + 3] = 255;
}
else
{
data[(x << 2) + 3] = 255;
data[(x << 2) + 3] = 0;
}
}
png_bytep row_ptr = data;