#endif
}
-// Create from XPM data
-bool wxBitmap::CreateFromXpm(const char **data)
-{
-#if wxUSE_IMAGE && wxUSE_XPM && wxUSE_WXDIB
- wxCHECK_MSG( data != NULL, false, wxT("invalid bitmap data") );
-
- wxXPMDecoder decoder;
- wxImage img = decoder.ReadData(data);
- wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") );
-
- *this = wxBitmap(img);
- return true;
-#else
- wxUnusedVar(data);
- return false;
-#endif
-}
-
wxBitmap::wxBitmap(int w, int h, int d)
{
(void)Create(w, h, d);
(void)Create(w, h, dc);
}
-wxBitmap::wxBitmap(void *data, long type, int width, int height, int depth)
+wxBitmap::wxBitmap(const void* data, long type, int width, int height, int depth)
{
(void)Create(data, type, width, height, depth);
}
return false;
}
-bool wxBitmap::Create(void *data, long type, int width, int height, int depth)
+bool wxBitmap::Create(const void* data, long type, int width, int height, int depth)
{
UnRef();
// ----------------------------------------------------------------------------
bool wxBitmapHandler::Create(wxGDIImage *image,
- void *data,
+ const void* data,
long flags,
int width, int height, int depth)
{
wxBitmap *bitmap = wxDynamicCast(image, wxBitmap);
- return bitmap ? Create(bitmap, data, flags, width, height, depth) : false;
+ return bitmap && Create(bitmap, data, flags, width, height, depth);
}
bool wxBitmapHandler::Load(wxGDIImage *image,
{
wxBitmap *bitmap = wxDynamicCast(image, wxBitmap);
- return bitmap ? LoadFile(bitmap, name, flags, width, height) : false;
+ return bitmap && LoadFile(bitmap, name, flags, width, height);
}
bool wxBitmapHandler::Save(wxGDIImage *image,
{
wxBitmap *bitmap = wxDynamicCast(image, wxBitmap);
- return bitmap ? SaveFile(bitmap, name, type) : false;
+ return bitmap && SaveFile(bitmap, name, type);
}
bool wxBitmapHandler::Create(wxBitmap *WXUNUSED(bitmap),
- void *WXUNUSED(data),
+ const void* WXUNUSED(data),
long WXUNUSED(type),
int WXUNUSED(width),
int WXUNUSED(height),