X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b598ec915c599ed3d2f68cf72ddf60bb91f73bb2..c4709ea55c2299c61ecda2ac350370f656de16ca:/src/common/image.cpp diff --git a/src/common/image.cpp b/src/common/image.cpp index 02df26fdd9..125e97613a 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -148,17 +148,6 @@ wxImage::wxImage( wxInputStream& stream, const wxString& mimetype, int index ) } #endif // wxUSE_STREAMS -wxImage::wxImage( const wxImage& image ) - : wxObject() -{ - Ref(image); -} - -wxImage::wxImage( const wxImage* image ) -{ - if (image) Ref(*image); -} - wxImage::wxImage( const char** xpmData ) { Create(xpmData); @@ -261,9 +250,18 @@ wxImage wxImage::Copy() const image.SetMask( M_IMGDATA->m_hasMask ); 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;