Fixed rescaling wxBitmap.
Create rescaled wxBitmap with the same colour depth as the source bitmap.
This commit is contained in:
@@ -222,7 +222,7 @@ void wxArtProvider::RescaleBitmap(wxBitmap& bmp, const wxSize& sizeNeeded)
|
|||||||
bmp = wxBitmap(img);
|
bmp = wxBitmap(img);
|
||||||
#else // !wxUSE_IMAGE
|
#else // !wxUSE_IMAGE
|
||||||
// Fallback method of scaling the bitmap
|
// Fallback method of scaling the bitmap
|
||||||
wxBitmap newBmp(sizeNeeded);
|
wxBitmap newBmp(sizeNeeded, bmp.GetDepth());
|
||||||
#if defined(__WXMSW__) || defined(__WXOSX__)
|
#if defined(__WXMSW__) || defined(__WXOSX__)
|
||||||
// wxBitmap::UseAlpha() is used only on wxMSW and wxOSX.
|
// wxBitmap::UseAlpha() is used only on wxMSW and wxOSX.
|
||||||
newBmp.UseAlpha(bmp.HasAlpha());
|
newBmp.UseAlpha(bmp.HasAlpha());
|
||||||
|
@@ -945,7 +945,7 @@ static void RescaleBitmap(wxBitmap& bmp, const wxSize& sizeNeeded)
|
|||||||
bmp = wxBitmap(img);
|
bmp = wxBitmap(img);
|
||||||
#else // !wxUSE_IMAGE
|
#else // !wxUSE_IMAGE
|
||||||
// Fallback method of scaling the bitmap
|
// Fallback method of scaling the bitmap
|
||||||
wxBitmap newBmp(sizeNeeded);
|
wxBitmap newBmp(sizeNeeded, bmp.GetDepth());
|
||||||
#if defined(__WXMSW__) || defined(__WXOSX__)
|
#if defined(__WXMSW__) || defined(__WXOSX__)
|
||||||
// wxBitmap::UseAlpha() is used only on wxMSW and wxOSX.
|
// wxBitmap::UseAlpha() is used only on wxMSW and wxOSX.
|
||||||
newBmp.UseAlpha(bmp.HasAlpha());
|
newBmp.UseAlpha(bmp.HasAlpha());
|
||||||
|
Reference in New Issue
Block a user