//-----------------------------------------------------------------------------
-#define M_BMPDATA wx_static_cast(wxBitmapRefData*, m_refData)
+#define M_BMPDATA static_cast<wxBitmapRefData*>(m_refData)
IMPLEMENT_DYNAMIC_CLASS(wxBitmap,wxGDIObject)
wxCHECK2_MSG(bits != NULL, return, wxT("invalid bitmap data"));
GdkBitmap* mask = NULL;
- SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, wx_const_cast(char**, bits)));
+ SetPixmap(gdk_pixmap_create_from_xpm_d(wxGetRootWindow()->window, &mask, NULL, const_cast<char**>(bits)));
if (M_BMPDATA->m_pixmap != NULL && mask != NULL)
{
if (depth == 32)
{
SetPixbuf(gdk_pixbuf_new(GDK_COLORSPACE_RGB, true, 8, width, height), 32);
+ // must initialize alpha, otherwise GetPixmap()
+ // will create a mask out of garbage
+ gdk_pixbuf_fill(M_BMPDATA->m_pixbuf, 0x000000ff);
} else
if (depth == 24)
{
wxGDIRefData* wxBitmap::CloneGDIRefData(const wxGDIRefData* data) const
{
- const wxBitmapRefData* oldRef = wx_static_cast(const wxBitmapRefData*, data);
+ const wxBitmapRefData* oldRef = static_cast<const wxBitmapRefData*>(data);
wxBitmapRefData* newRef = new wxBitmapRefData;
newRef->m_width = oldRef->m_width;
newRef->m_height = oldRef->m_height;