Use high quality in wxBitmap::Rescale()
This function is currently used for relatively small icons in wxArtProvider and wxSearchCtrl, so it shouldn't be a problem to use wxIMAGE_QUALITY_HIGH from performance point of view and if it ever does become a problem, the application could easily use wxImage::Rescale() with a different option directly instead.
This commit is contained in:
@@ -685,8 +685,13 @@ public:
|
|||||||
/**
|
/**
|
||||||
Rescale the given bitmap to the requested size.
|
Rescale the given bitmap to the requested size.
|
||||||
|
|
||||||
This function uses wxImage::Rescale() to resize the given @a bmp to the
|
This function is just a convenient wrapper for wxImage::Rescale() used
|
||||||
requested size. Both the bitmap itself and size must be valid.
|
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.
|
||||||
|
|
||||||
|
Both the bitmap itself and size must be valid.
|
||||||
|
|
||||||
@since 3.1.6
|
@since 3.1.6
|
||||||
*/
|
*/
|
||||||
|
@@ -71,7 +71,7 @@ void wxBitmapHelpers::Rescale(wxBitmap& bmp, const wxSize& sizeNeeded)
|
|||||||
|
|
||||||
#if wxUSE_IMAGE
|
#if wxUSE_IMAGE
|
||||||
wxImage img = bmp.ConvertToImage();
|
wxImage img = bmp.ConvertToImage();
|
||||||
img.Rescale(sizeNeeded.x, sizeNeeded.y);
|
img.Rescale(sizeNeeded.x, sizeNeeded.y, wxIMAGE_QUALITY_HIGH);
|
||||||
bmp = wxBitmap(img);
|
bmp = wxBitmap(img);
|
||||||
#else // !wxUSE_IMAGE
|
#else // !wxUSE_IMAGE
|
||||||
// Fallback method of scaling the bitmap
|
// Fallback method of scaling the bitmap
|
||||||
|
Reference in New Issue
Block a user