added wxUSE_PALETTE and fixed compilation with it set to 0

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2001-09-30 22:06:39 +00:00
parent f1c1831fc5
commit d275c7eb84
21 changed files with 227 additions and 101 deletions

View File

@@ -708,12 +708,14 @@ bool wxLoadIntoBitmap(wxChar *filename, wxBitmap *bitmap, wxPalette **pal)
if (hPalette)
{
#if wxUSE_PALETTE
if (pal)
{
*pal = new wxPalette;
(*pal)->SetHPALETTE((WXHPALETTE) hPalette);
}
else
#endif // wxUSE_PALETTE
DeleteObject(hPalette);
}
else if (pal)
@@ -928,8 +930,10 @@ HANDLE wxBitmapToDIB (HBITMAP hBitmap, HPALETTE hPal)
bool wxSaveBitmap(wxChar *filename, wxBitmap *bitmap, wxPalette *colourmap)
{
HPALETTE hPalette = 0;
#if wxUSE_PALETTE
if (colourmap)
hPalette = (HPALETTE) colourmap->GetHPALETTE();
#endif // wxUSE_PALETTE
HANDLE dibHandle = wxBitmapToDIB((HBITMAP) bitmap->GetHBITMAP(), hPalette);
if (dibHandle)