From 2072bfa00efb9941895c71e954322bb7d213cf4a Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 26 Feb 2016 21:22:18 +0100 Subject: [PATCH] Fixed rescaling wxBitmap. Create rescaled wxBitmap with the same colour depth as the source bitmap. --- src/common/artprov.cpp | 2 +- src/generic/srchctlg.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index c8fd5fe80b..e7466eee26 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -222,7 +222,7 @@ void wxArtProvider::RescaleBitmap(wxBitmap& bmp, const wxSize& sizeNeeded) bmp = wxBitmap(img); #else // !wxUSE_IMAGE // Fallback method of scaling the bitmap - wxBitmap newBmp(sizeNeeded); + wxBitmap newBmp(sizeNeeded, bmp.GetDepth()); #if defined(__WXMSW__) || defined(__WXOSX__) // wxBitmap::UseAlpha() is used only on wxMSW and wxOSX. newBmp.UseAlpha(bmp.HasAlpha()); diff --git a/src/generic/srchctlg.cpp b/src/generic/srchctlg.cpp index a0a5e3336f..eed9aa7348 100644 --- a/src/generic/srchctlg.cpp +++ b/src/generic/srchctlg.cpp @@ -945,7 +945,7 @@ static void RescaleBitmap(wxBitmap& bmp, const wxSize& sizeNeeded) bmp = wxBitmap(img); #else // !wxUSE_IMAGE // Fallback method of scaling the bitmap - wxBitmap newBmp(sizeNeeded); + wxBitmap newBmp(sizeNeeded, bmp.GetDepth()); #if defined(__WXMSW__) || defined(__WXOSX__) // wxBitmap::UseAlpha() is used only on wxMSW and wxOSX. newBmp.UseAlpha(bmp.HasAlpha());