#include "wx/log.h"
#include "wx/control.h"
#include "wx/dcmemory.h"
+#include "wx/image.h"
+#ifdef __VMS__
+#pragma message disable nosimpint
+#endif
#include <Xm/Xm.h>
+#ifdef __VMS__
+#pragma message enable nosimpint
+#endif
#include "wx/motif/private.h"
#include <X11/xpm.h>
#endif
-#if !USE_SHARED_LIBRARIES
IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxGDIObject)
IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
-#endif
wxBitmapRefData::wxBitmapRefData()
{
wxBitmapHandler *handler = FindHandler(type);
if ( handler == NULL ) {
- wxLogWarning("%s: no bitmap handler for type %d defined.", (const char*) filename, type);
-
- return FALSE;
+ wxImage image;
+ if (!image.LoadFile( filename, type )) return FALSE;
+ if (image.Ok())
+ {
+ *this = image.ConvertToBitmap();
+ return TRUE;
+ }
+ else return FALSE;
}
return handler->LoadFile(this, filename, type, -1, -1);
{
wxBitmapHandler *handler = FindHandler(type);
- if ( handler == NULL ) {
- wxLogWarning("no bitmap handler for type %d defined.", type);
-
- return FALSE;
+ if ( handler == NULL ) { // try wxImage
+ wxImage image( *this );
+ if (image.Ok()) return image.SaveFile( filename, type );
+ else return FALSE;
}
return handler->SaveFile(this, filename, type, palette);
// Creates a bitmap with transparent areas drawn in
// the given colour.
-wxBitmap wxCreateMaskedBitmap(wxBitmap& bitmap, wxColour& colour)
+wxBitmap wxCreateMaskedBitmap(const wxBitmap& bitmap, wxColour& colour)
{
wxBitmap newBitmap(bitmap.GetWidth(),
bitmap.GetHeight(),