From 630b7fd5d74b58bdc9e99a1e23feb9347023824b Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 12 Jan 2015 20:37:34 +0000 Subject: [PATCH] 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 --- src/propgrid/property.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index aabaa9e7d0..6d5d8edc9a 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -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;