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