X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04ef50df3a0fa3c343800c554e609f98fc7575cc..038072e2f1eaf2bf32d748a71234d767ebba8919:/src/msw/bitmap.cpp diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index d6e1ddd207..8e8b4e0832 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -242,9 +242,9 @@ wxBitmap::wxBitmap(const char bits[], int width, int height, int depth) // we assume that it is in XBM format which is not quite the same as // the format CreateBitmap() wants because the order of bytes in the // line is inversed! - static const size_t bytesPerLine = (width + 7) / 8; - static const size_t padding = bytesPerLine % 2; - static const size_t len = height * ( padding + bytesPerLine ); + const size_t bytesPerLine = (width + 7) / 8; + const size_t padding = bytesPerLine % 2; + const size_t len = height * ( padding + bytesPerLine ); data = (char *)malloc(len); const char *src = bits; char *dst = data; @@ -297,15 +297,15 @@ bool wxBitmap::CreateFromXpm(const char **data) Init(); 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 - return FALSE; + return FALSE; #endif } @@ -382,6 +382,10 @@ bool wxBitmap::Create(int w, int h, int d) bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) { +#ifdef __WXMICROWIN__ + // TODO + return FALSE; +#else wxCHECK_MSG( image.Ok(), FALSE, wxT("invalid image") ) m_refData = new wxBitmapRefData(); @@ -604,10 +608,15 @@ bool wxBitmap::CreateFromImage( const wxImage& image, int depth ) if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); return TRUE; +#endif } wxImage wxBitmap::ConvertToImage() const { +#ifdef __WXMICROWIN__ + // TODO + return wxImage(); +#else wxImage image; wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") ); @@ -732,6 +741,7 @@ wxImage wxBitmap::ConvertToImage() const free(lpBits); return image; +#endif } #endif // wxUSE_IMAGE