Save the alpha values if the image has an alpha channel

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27799 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2004-06-15 01:05:10 +00:00
parent 8a07b43cf6
commit 5f5183d34b

View File

@ -700,7 +700,11 @@ 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 (( !image->HasMask() ) || \
if ( image->HasAlpha() )
{
data[(x << 2) + 3] = image->GetAlpha(x, y);
}
else if (( !image->HasMask() ) || \
(data[(x << 2) + 0] != image->GetMaskRed()) || \
(data[(x << 2) + 1] != image->GetMaskGreen()) || \
(data[(x << 2) + 2] != image->GetMaskBlue()))