From a5934f33e229c3824634cf5b7919413100d9cc62 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 28 Dec 2019 23:22:37 +0100 Subject: [PATCH] Fix building image sample with wxUSE_PALETTE==0 --- samples/image/image.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/samples/image/image.cpp b/samples/image/image.cpp index 819da2578f..00380c9a73 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -258,7 +258,9 @@ private: wxBMP_8BPP, wxBMP_8BPP_GREY, wxBMP_8BPP_RED, +#if wxUSE_PALETTE wxBMP_8BPP_PALETTE, +#endif // wxUSE_PALETTE wxBMP_24BPP }; @@ -270,7 +272,9 @@ private: "8 bpp color", "8 bpp greyscale", "8 bpp red", +#if wxUSE_PALETTE "8 bpp own palette", +#endif // wxUSE_PALETTE "24 bpp" }; @@ -283,7 +287,7 @@ private: { int format = bppvalues[bppselection]; image.SetOption(wxIMAGE_OPTION_BMP_FORMAT, format); - +#if wxUSE_PALETTE if ( format == wxBMP_8BPP_PALETTE ) { unsigned char *cmap = new unsigned char [256]; @@ -293,6 +297,7 @@ private: delete[] cmap; } +#endif // wxUSE_PALETTE } } #if wxUSE_LIBPNG