From 0a91a2f40ba9ef6c8ace668d15b0b7b34c5a770e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 21 Oct 2021 22:57:01 +0100 Subject: [PATCH] Use wxBitmap::Rescale() in wxGenericStaticBitmap code No real changes, just reuse the existing function instead of redoing it one more time. --- src/generic/statbmpg.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/generic/statbmpg.cpp b/src/generic/statbmpg.cpp index d2cbb334aa..3d20e2c4c1 100644 --- a/src/generic/statbmpg.cpp +++ b/src/generic/statbmpg.cpp @@ -55,7 +55,7 @@ void wxGenericStaticBitmap::OnPaint(wxPaintEvent& WXUNUSED(event)) if ( !drawSize.x || !drawSize.y ) return; - const wxBitmap bitmap = GetBitmap(); + wxBitmap bitmap = GetBitmap(); const wxSize bmpSize = bitmap.GetSize(); wxDouble w = 0; wxDouble h = 0; @@ -96,9 +96,8 @@ void wxGenericStaticBitmap::OnPaint(wxPaintEvent& WXUNUSED(event)) gc(wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc)); gc->DrawBitmap(bitmap, x, y, w, h); #else - wxImage img = bitmap.ConvertToImage(); - img.Rescale(wxRound(w), wxRound(h), wxIMAGE_QUALITY_HIGH); - dc.DrawBitmap(wxBitmap(img), wxRound(x), wxRound(y), true); + wxBitmap::Rescale(bitmap, wxSize(wxRound(w), wxRound(h))); + dc.DrawBitmap(bitmap, wxRound(x), wxRound(y), true); #endif }