diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index cb8d3144fc..0bc97e12e0 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -271,7 +271,9 @@ bool wxBMPHandler::SaveDib(wxImage *image, } } +#if wxUSE_PALETTE wxScopedPtr palette; // entries for quantized images +#endif // wxUSE_PALETTE wxScopedArray rgbquad; // for the RGBQUAD bytes for the colormap wxScopedPtr q_image; // destination for quantized image @@ -287,10 +289,15 @@ bool wxBMPHandler::SaveDib(wxImage *image, // I get a delete error using Quantize when desired colors > 236 int quantize = ((palette_size > 236) ? 236 : palette_size); // fill the destination too, it gives much nicer 4bpp images +#if wxUSE_PALETTE wxPalette* paletteTmp; wxQuantize::Quantize( *image, *q_image, &paletteTmp, quantize, 0, wxQUANTIZE_FILL_DESTINATION_IMAGE ); palette.reset(paletteTmp); +#else // !wxUSE_PALETTE + wxQuantize::Quantize( *image, *q_image, NULL, quantize, 0, + wxQUANTIZE_FILL_DESTINATION_IMAGE ); +#endif // wxUSE_PALETTE/!wxUSE_PALETTE } else {