X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17dff81c7141e142765b168ab225e5c61475669f..1363811bb6338fb0dad6c16cfa47f46fb1eb3b99:/src/msw/dib.cpp diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index ac6bffe7dd..bd573f2791 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -35,20 +35,24 @@ #ifndef WX_PRECOMP #include "wx/setup.h" #include "wx/defs.h" +#include "wx/bitmap.h" #endif #include #include #include -#ifndef __MWERKS__ + +#if !defined(__MWERKS__) && !defined(__SALFORDC__) #include #endif #include "wx/msw/dib.h" +#ifndef __TWIN32__ #ifdef __GNUWIN32__ #include "wx/msw/gnuwin32/extra.h" #endif +#endif #ifndef SEEK_CUR /* flags for _lseek */ @@ -257,7 +261,7 @@ HANDLE DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal) dwLen = bi.biSize + PaletteSize(&bi); - hdc = GetDC(NULL); + hdc = GetDC((HWND) NULL); hpal = SelectPalette(hdc, hpal, FALSE); RealizePalette(hdc); @@ -325,7 +329,7 @@ HANDLE DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal) GlobalUnlock(hdib); hdib = NULL; SelectPalette(hdc, hpal, FALSE); - ReleaseDC(NULL, hdc); + ReleaseDC((HWND) NULL, hdc); return NULL; } @@ -688,7 +692,7 @@ HPALETTE MakeDIBPalette(LPBITMAPINFOHEADER lpInfo) return((HPALETTE) GetStockObject(DEFAULT_PALETTE)); } -bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxColourMap **pal) +bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxPalette **pal) { HBITMAP hBitmap; HPALETTE hPalette; @@ -705,7 +709,7 @@ bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxColourMap **pal) { if (pal) { - *pal = new wxColourMap; + *pal = new wxPalette; (*pal)->SetHPALETTE((WXHPALETTE) hPalette); } else @@ -729,7 +733,7 @@ bool wxLoadIntoBitmap(char *filename, wxBitmap *bitmap, wxColourMap **pal) else return FALSE; } -wxBitmap *wxLoadBitmap(char *filename, wxColourMap **pal) +wxBitmap *wxLoadBitmap(char *filename, wxPalette **pal) { wxBitmap *bitmap = new wxBitmap; if (wxLoadIntoBitmap(filename, bitmap, pal)) @@ -918,7 +922,7 @@ HANDLE BitmapToDIB (HBITMAP hBitmap, HPALETTE hPal) return hDIB; } -bool wxSaveBitmap(char *filename, wxBitmap *bitmap, wxColourMap *colourmap) +bool wxSaveBitmap(char *filename, wxBitmap *bitmap, wxPalette *colourmap) { HPALETTE hPalette = 0; if (colourmap)