From 3242feb1c09fd28c5a41ed1ee76e37d56213f19b Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sun, 24 Mar 2002 00:22:33 +0000 Subject: [PATCH] add automatic rescaling to wxArtProvider git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14753 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/artprov.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index 1c18b538ca..27a7d54d90 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -32,6 +32,7 @@ #include "wx/artprov.h" #include "wx/hashmap.h" #include "wx/module.h" +#include "wx/image.h" // For the purposes of forcing this module to link extern char g_ArtProviderModule; @@ -168,8 +169,18 @@ wxArtProviderCache *wxArtProvider::sm_cache = NULL; { bmp = node->GetData()->CreateBitmap(id, client, size); if ( bmp.Ok() ) + { + if ( size != wxDefaultSize && + (bmp.GetWidth() != size.x || bmp.GetHeight() != size.y) ) + { + wxImage img = bmp.ConvertToImage(); + img.Rescale(size.x, size.y); + bmp = wxBitmap(img); + } break; + } } + sm_cache->PutBitmap(hashId, bmp); } -- 2.45.2