diff --git a/interface/wx/bitmap.h b/interface/wx/bitmap.h index 7f06e9cec6..b39d1a6faa 100644 --- a/interface/wx/bitmap.h +++ b/interface/wx/bitmap.h @@ -837,8 +837,8 @@ public: This function is just a convenient wrapper for wxImage::Rescale() used to resize the given @a bmp to the requested size. If you need more control over resizing, e.g. to specify the quality option different - from ::wxIMAGE_QUALITY_HIGH used by default, please use wxImage - function directly instead. + from ::wxIMAGE_QUALITY_NEAREST used by this function, please use the + wxImage function directly instead. Both the bitmap itself and size must be valid. diff --git a/src/common/bmpbase.cpp b/src/common/bmpbase.cpp index d511ee5a04..320a80ebb3 100644 --- a/src/common/bmpbase.cpp +++ b/src/common/bmpbase.cpp @@ -70,8 +70,11 @@ void wxBitmapHelpers::Rescale(wxBitmap& bmp, const wxSize& sizeNeeded) wxCHECK_RET( sizeNeeded.IsFullySpecified(), wxS("New size must be given") ); #if wxUSE_IMAGE + // Note that we use "nearest" rescale mode here to preserve sharp edges in + // the icons for which this function is often used. It's also consistent + // with what wxDC::DrawBitmap() does, i.e. the fallback method below. wxImage img = bmp.ConvertToImage(); - img.Rescale(sizeNeeded.x, sizeNeeded.y, wxIMAGE_QUALITY_HIGH); + img.Rescale(sizeNeeded.x, sizeNeeded.y, wxIMAGE_QUALITY_NEAREST); bmp = wxBitmap(img); #else // !wxUSE_IMAGE // Fallback method of scaling the bitmap