Fixed rescaling wxBitmap.

Create rescaled wxBitmap with the same colour depth as the source bitmap.
This commit is contained in:
Artur Wieczorek 2016-02-26 21:22:18 +01:00
parent 5b2724c900
commit 2072bfa00e
2 changed files with 2 additions and 2 deletions

View File

@ -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());

View File

@ -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());