]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/dib.cpp
don't append anything back in DoDeleteOneItem() if the control becomes empty (fixes...
[wxWidgets.git] / src / msw / dib.cpp
index 2abcde95b7fddca404af6d7f4ba47abd1968c828..3acfa95d2607bc07f0873e835359632ea8763ce4 100644 (file)
@@ -45,7 +45,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#if !defined(__MWERKS__) && !defined(__SALFORDC__)
+#if !defined(__MWERKS__)
     #include <memory.h>
 #endif
 
@@ -307,6 +307,7 @@ bool wxDIB::Save(const wxString& filename)
 {
     wxCHECK_MSG( m_handle, false, _T("wxDIB::Save(): invalid object") );
 
+#if wxUSE_FILE
     wxFile file(filename, wxFile::write);
     bool ok = file.IsOpened();
     if ( ok )
@@ -335,6 +336,9 @@ bool wxDIB::Save(const wxString& filename)
                         file.Write(ds.dsBm.bmBits, sizeImage) == sizeImage;
         }
     }
+#else // !wxUSE_FILE
+    bool ok = false;
+#endif // wxUSE_FILE/!wxUSE_FILE
 
     if ( !ok )
     {
@@ -785,9 +789,9 @@ wxImage wxDIB::ConvertToImage() const
                     *alpha++ = a;
                     if ( a > 0 )
                     {
-                        dst[0] = (dst[0] * 255 - 127) / a;
-                        dst[1] = (dst[1] * 255 - 127) / a;
-                        dst[2] = (dst[2] * 255 - 127) / a;
+                        dst[0] = (dst[0] * 255) / a;
+                        dst[1] = (dst[1] * 255) / a;
+                        dst[2] = (dst[2] * 255) / a;
                     }
                 }