]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/image.cpp
GTK2: gtk_window_set_policy -> gtk_window_set_resizable. Slight change for resizable...
[wxWidgets.git] / src / common / image.cpp
index d261424034f36923d31e1afa658ab1164c3519df..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;
 
@@ -1594,7 +1603,7 @@ bool wxImage::LoadFile( wxInputStream& stream, long type, int index )
         return false;
     }
 
-    if (!handler->CanRead(stream))
+    if (stream.IsSeekable() && !handler->CanRead(stream))
     {
         wxLogError(_("Image file is not of type %d."), type);
         return false;
@@ -1618,7 +1627,7 @@ bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype, int ind
         return false;
     }
 
-    if (!handler->CanRead(stream))
+    if (stream.IsSeekable() && !handler->CanRead(stream))
     {
         wxLogError(_("Image file is not of type %s."), (const wxChar*) mimetype);
         return false;