]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/image.cpp
wxControl::SetLabel no longer strips out codes so do it here
[wxWidgets.git] / src / common / image.cpp
index 02df26fdd920c31c18bc6770c99a1f6035211581..807bdd28902ee11fa68883beb16f3204af57ddf2 100644 (file)
@@ -261,9 +261,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;