Preserve alpha channel flag when rescaling bitmap in wxPGProperty::SetValueImage (when wxUSE_IMAGE == 0).

Rescaled bitmap must have the same alpha channel flag as the source bitmap flag in order to be properly displayed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek
2015-01-12 20:37:34 +00:00
parent 66e48fd84b
commit 630b7fd5d7

View File

@@ -2151,11 +2151,13 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp )
#else
// This is the old, deprecated method of scaling the image
wxBitmap* bmpNew = new wxBitmap(maxSz.x,maxSz.y,bmp.GetDepth());
wxMemoryDC dc;
dc.SelectObject(*bmpNew);
double scaleY = (double)maxSz.y / (double)imSz.y;
dc.SetUserScale(scaleY, scaleY);
dc.DrawBitmap(bmp, 0, 0);
bmpNew->UseAlpha(bmp.HasAlpha());
{
wxMemoryDC dc(*bmpNew);
double scaleY = (double)maxSz.y / (double)imSz.y;
dc.SetUserScale(scaleY, scaleY);
dc.DrawBitmap(bmp, 0, 0);
}
#endif
m_valueBitmap = bmpNew;