bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap,
const wxString& name,
int WXUNUSED(type),
- const wxPalette *pal)
+ const wxPalette * WXUNUSED(pal))
{
-#if wxUSE_IMAGE_LOADING_IN_MSW
-
-#if wxUSE_PALETTE
- wxPalette *actualPalette = (wxPalette *)pal;
- if ( !actualPalette )
- actualPalette = bitmap->GetPalette();
-#else
- wxPalette *actualPalette = NULL;
-#endif // wxUSE_PALETTE
-
- return wxSaveBitmap(WXSTRINGCAST name, bitmap, actualPalette) != 0;
-#else
- return false;
-#endif
+ wxCHECK_MSG( bitmap, false, _T("NULL bitmap in SaveFile") );
+
+ wxDIB dib(*bitmap);
+
+ return dib.Save(name);
}
// ----------------------------------------------------------------------------