From 0429e043a80dface19685cd612a400df34c50d59 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Sun, 27 Feb 2011 08:51:01 +0000 Subject: [PATCH] Include image.h and check for wxUSE_IMAGE git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/property.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 0d0826386e..f878d4ddda 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -35,6 +35,8 @@ #include "wx/intl.h" #endif +#include "wx/image.h" + #include "wx/propgrid/propgrid.h" @@ -2097,6 +2099,7 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp ) if ( imSz.y != maxSz.y ) { + #if wxUSE_IMAGE // Here we use high-quality wxImage scaling functions available wxImage img = bmp.ConvertToImage(); double scaleY = (double)maxSz.y / (double)imSz.y; @@ -2104,6 +2107,15 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp ) ((double)bmp.GetHeight())*scaleY, wxIMAGE_QUALITY_HIGH); wxBitmap* bmpNew = new wxBitmap(img, 32); + #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); + #endif m_valueBitmap = bmpNew; } -- 2.47.2