wxImage::Copy() forgot the alpha channel.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2006-01-26 12:07:10 +00:00
parent 22b9d4ac49
commit a1cd956478

View File

@ -262,8 +262,17 @@ wxImage wxImage::Copy() const
memcpy( data, GetData(), M_IMGDATA->m_width*M_IMGDATA->m_height*3 );
// also copy the image options
wxImageRefData *imgData = (wxImageRefData *)image.m_refData;
// also copy the alpha channel
if (HasAlpha())
{
image.SetAlpha();
unsigned char* alpha = image.GetAlpha();
memcpy( alpha, GetAlpha(), M_IMGDATA->m_width*M_IMGDATA->m_height );
}
// also copy the image options
imgData->m_optionNames = M_IMGDATA->m_optionNames;
imgData->m_optionValues = M_IMGDATA->m_optionValues;