X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/debe6624c1e9d4bf3243381153d1e173c849bcd8..90186e524e347a3a779c928a44fb7d744b3efcf7:/src/msw/pnghand.cpp diff --git a/src/msw/pnghand.cpp b/src/msw/pnghand.cpp index c6fad8a66b..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();