Replace multiple RescaleBitmap() with wxBitmap::Rescale()

Define a single function and use it in both wxArtProvider and (the
generic implementation of) wxSearchCtrl instead of repeating the same
code elsewhere.

Note that another, but slightly different, version of RescaleBitmap()
still remains in wxPropertyGrid.

Deprecate undocumented wxArtProvider::RescaleBitmap() which is
completely useless now.

No real changes, this is just a refactoring.
This commit is contained in:
Vadim Zeitlin
2021-09-23 22:46:53 +01:00
parent 46314bd6b1
commit 024c231624
7 changed files with 52 additions and 55 deletions

View File

@@ -682,6 +682,16 @@ public:
*/
static bool RemoveHandler(const wxString& name);
/**
Rescale the given bitmap to the requested size.
This function uses wxImage::Rescale() to resize the given @a bmp to the
requested size. Both the bitmap itself and size must be valid.
@since 3.1.6
*/
static void Rescale(wxBitmap& bmp, const wxSize& sizeNeeded);
/**
Saves a bitmap in the named file.