X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/dc4025af9a663583878b02e30073e29205ae5d9f..1a19e369fbce12ce4d8097fc08609a436748a6ed:/src/x11/bitmap.cpp diff --git a/src/x11/bitmap.cpp b/src/x11/bitmap.cpp index a365ddf028..8663744e46 100644 --- a/src/x11/bitmap.cpp +++ b/src/x11/bitmap.cpp @@ -91,7 +91,7 @@ bool wxMask::Create( const wxBitmap& bitmap, m_display = bitmap.GetDisplay(); - wxImage image( bitmap ); + wxImage image = bitmap.ConvertToImage(); if (!image.Ok()) return FALSE; m_display = bitmap.GetDisplay(); @@ -370,7 +370,7 @@ bool wxBitmap::CreateFromXpm( const char **bits ) XGetGeometry( xdisplay, pixmap, &xroot, &xRet, &yRet, &widthRet, &heightRet, &borderWidthRet, &depthRet); - wxASSERT_MSG( bpp == (int)depthRet, wxT("colour depth mismatch") ) + wxASSERT_MSG( bpp == (int)depthRet, wxT("colour depth mismatch") ); #endif XpmFreeAttributes(&xpmAttr); @@ -733,14 +733,14 @@ wxImage wxBitmap::ConvertToImage() const Display *xdisplay = (Display*) M_BMPDATA->m_display; wxASSERT_MSG( xdisplay, wxT("No display") ); - - int bpp = wxTheApp->m_visualDepth; #if wxUSE_NANOX + //int bpp = DefaultDepth(xdisplay, xscreen); wxGetImageFromDrawable((Pixmap) GetPixmap(), 0, 0, GetWidth(), GetHeight(), image); return image; #else // !wxUSE_NANOX + int bpp = wxTheApp->m_visualDepth; XImage *x_image = NULL; if (GetPixmap()) { @@ -1022,7 +1022,7 @@ bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(pal // Try to save the bitmap via wxImage handlers: { - wxImage image( *this ); + wxImage image(this->ConvertToImage()) ; if (image.Ok()) return image.SaveFile( name, type ); } @@ -1111,7 +1111,7 @@ bool wxBitmap::LoadFile( const wxString &name, int type ) { wxImage image; if (!image.LoadFile( name, type )) return FALSE; - if (image.Ok()) *this = image.ConvertToBitmap(); + if (image.Ok()) *this = wxBitmap(image); else return FALSE; }