X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2bda0e173844e8e0f8acf4e8ad8b5c26e5c6fe5d..d311155fa2c85587286ea271bd5c9546faf9aa90:/src/msw/pnghand.cpp diff --git a/src/msw/pnghand.cpp b/src/msw/pnghand.cpp index 554e1cca16..2f82fa3e10 100644 --- a/src/msw/pnghand.cpp +++ b/src/msw/pnghand.cpp @@ -24,8 +24,19 @@ #include #include #include + +#if wxUSE_IOSTREAMH #include +#else +#include +# ifdef _MSC_VER + using namespace std; +# endif +#endif + #include +#include +#include #include #include @@ -113,7 +124,11 @@ wxPNGReader::Create(int width, int height, int depth, int colortype) ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0); if (lpbi) { +#ifdef __WIN16__ + GlobalFreePtr((unsigned int) lpbi); +#else GlobalFreePtr(lpbi); +#endif // delete Palette; } RawImage = 0; @@ -128,7 +143,11 @@ wxPNGReader::Create(int width, int height, int depth, int colortype) wxPNGReader::~wxPNGReader ( ) { if (lpbi) { +#ifdef __WIN16__ + GlobalFreePtr((unsigned int) lpbi); +#else GlobalFreePtr(lpbi); +#endif delete Palette; } } @@ -271,7 +290,7 @@ bool wxPNGReader::InstantiateBitmap(wxBitmap *bitmap) HDC dc2 = GetDC(NULL); HBITMAP tmpBitmap = ::CreateCompatibleBitmap(dc2, GetWidth(), GetHeight()); ReleaseDC(NULL, dc2); - HBITMAP oldBitmap = ::SelectObject(dc, tmpBitmap); + HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, tmpBitmap); if ( Palette ) { @@ -342,7 +361,7 @@ wxMask *wxPNGReader::CreateMask(void) HBITMAP hBitmap = ::CreateBitmap(GetWidth(), GetHeight(), 1, 1, NULL); HDC dc = ::CreateCompatibleDC(NULL); - HBITMAP oldBitmap = ::SelectObject(dc, hBitmap); + HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, hBitmap); int bgIndex = GetBGIndex(); @@ -749,7 +768,7 @@ bool wxPNGReader::SaveXPM(char *filename, char *name) IMPLEMENT_DYNAMIC_CLASS(wxPNGFileHandler, wxBitmapHandler) -bool wxPNGFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, const long flags, +bool wxPNGFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, int desiredWidth, int desiredHeight) { wxPNGReader reader; @@ -761,7 +780,7 @@ bool wxPNGFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, const lo return FALSE; } -bool wxPNGFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, const int type, const wxPalette *pal) +bool wxPNGFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *pal) { return FALSE; }