diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index 7ff0a2785e..c8fd5fe80b 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -223,7 +223,10 @@ void wxArtProvider::RescaleBitmap(wxBitmap& bmp, const wxSize& sizeNeeded) #else // !wxUSE_IMAGE // Fallback method of scaling the bitmap wxBitmap newBmp(sizeNeeded); +#if defined(__WXMSW__) || defined(__WXOSX__) + // wxBitmap::UseAlpha() is used only on wxMSW and wxOSX. newBmp.UseAlpha(bmp.HasAlpha()); +#endif // __WXMSW__ || __WXOSX__ { wxMemoryDC dc(newBmp); double scX = (double)sizeNeeded.GetWidth() / bmp.GetWidth(); diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 3b8a6bbcc0..f8973cd1f6 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -2209,7 +2209,7 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp ) if ( imSz.y != maxSz.y ) { - #if wxUSE_IMAGE +#if wxUSE_IMAGE // Here we use high-quality wxImage scaling functions available wxImage img = bmp.ConvertToImage(); double scaleY = (double)maxSz.y / (double)imSz.y; @@ -2217,17 +2217,20 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp ) wxRound(bmp.GetHeight()*scaleY), wxIMAGE_QUALITY_HIGH); wxBitmap* bmpNew = new wxBitmap(img); - #else +#else // !wxUSE_IMAGE // This is the old, deprecated method of scaling the image wxBitmap* bmpNew = new wxBitmap(maxSz.x,maxSz.y,bmp.GetDepth()); +#if defined(__WXMSW__) || defined(__WXOSX__) + // wxBitmap::UseAlpha() is used only on wxMSW and wxOSX. bmpNew->UseAlpha(bmp.HasAlpha()); +#endif // __WXMSW__ || __WXOSX__ { wxMemoryDC dc(*bmpNew); double scaleY = (double)maxSz.y / (double)imSz.y; dc.SetUserScale(scaleY, scaleY); dc.DrawBitmap(bmp, 0, 0); } - #endif +#endif // wxUSE_IMAGE/!wxUSE_IMAGE m_valueBitmap = bmpNew; }