diff --git a/docs/doxygen/overviews/high_dpi.md b/docs/doxygen/overviews/high_dpi.md index 63a6db3551..4d6337ae75 100644 --- a/docs/doxygen/overviews/high_dpi.md +++ b/docs/doxygen/overviews/high_dpi.md @@ -176,6 +176,9 @@ use "Logical", "Physical" or "DIP" in their names, the only exceptions are: wxBitmap::GetLogicalHeight() and wxBitmap::GetLogicalSize() to use or get the size in logical pixels which must be used in any computations involving the sizes expressed in logical units. +- Similarly, the size returned by wxBitmapBundle::GetPreferredBitmapSizeFor() + is in physical pixels, but wxBitmapBundle::GetPreferredLogicalSizeFor() can + be used to retrieve the same value in logical units. - The default size of wxBitmapBundle, taken by wxBitmapBundle::FromSVG() and returned by wxBitmapBundle::GetDefaultSize() is in DIPs. diff --git a/include/wx/bmpbndl.h b/include/wx/bmpbndl.h index c0eabee387..15083e01b4 100644 --- a/include/wx/bmpbndl.h +++ b/include/wx/bmpbndl.h @@ -99,11 +99,14 @@ public: // default DPI, i.e. 100% scaling. Returns invalid size for empty bundle. wxSize GetDefaultSize() const; + // Get the physical size of the preferred bitmap at the given scale. + wxSize GetPreferredBitmapSizeAtScale(double scale) const; + // Get preferred size, i.e. usually the closest size in which a bitmap is // available to the ideal size determined from the default size and the DPI - // scaling, for the given window. - wxSize GetPreferredSizeFor(const wxWindow* window) const; - wxSize GetPreferredSizeAtScale(double scale) const; + // scaling, for the given window, in physical/logical pixels respectively. + wxSize GetPreferredBitmapSizeFor(const wxWindow* window) const; + wxSize GetPreferredLogicalSizeFor(const wxWindow* window) const; // Get bitmap of the specified size, creating a new bitmap from the closest // available size by rescaling it if necessary. @@ -115,9 +118,9 @@ public: // GetBitmap() converting the returned bitmap to the icon. wxIcon GetIcon(const wxSize& size) const; - // Helpers combining GetBitmap() or GetIcon() and GetPreferredSizeFor(): - // return the bitmap or icon of the size appropriate for the current DPI - // scaling of the given window. + // Helpers combining GetPreferredBitmapSizeFor() and GetBitmap() or + // GetIcon(): return the bitmap or icon of the size appropriate for the + // current DPI scaling of the given window. wxBitmap GetBitmapFor(const wxWindow* window) const; wxIcon GetIconFor(const wxWindow* window) const; @@ -217,7 +220,7 @@ public: // Return the preferred size that should be used at the given scale. // // Must always return a valid size. - virtual wxSize GetPreferredSizeAtScale(double scale) const = 0; + virtual wxSize GetPreferredBitmapSizeAtScale(double scale) const = 0; // Retrieve the bitmap of exactly the given size. // diff --git a/interface/wx/bmpbndl.h b/interface/wx/bmpbndl.h index afc3cda298..18c93ed6f4 100644 --- a/interface/wx/bmpbndl.h +++ b/interface/wx/bmpbndl.h @@ -293,18 +293,30 @@ public: bitmap doesn't need to be rescaled, which typically significantly lowers its quality. */ - wxSize GetPreferredSizeAtScale(double scale) const; + wxSize GetPreferredBitmapSizeAtScale(double scale) const; /** Get the size that would be best to use for this bundle at the DPI scaling factor used by the given window. - This is just a convenient wrapper for GetPreferredSizeAtScale() calling + This is just a convenient wrapper for GetPreferredBitmapSizeAtScale() calling that function with the result of wxWindow::GetDPIScaleFactor(). @param window Non-null and fully created window. */ - wxSize GetPreferredSizeFor(const wxWindow* window) const; + wxSize GetPreferredBitmapSizeFor(const wxWindow* window) const; + + /** + Get the size that would be best to use for this bundle at the DPI + scaling factor used by the given window in logical size. + + This is just call GetPreferredBitmapSizeAtScale() with the result of + wxWindow::GetDPIScaleFactor() and convert returned value with + wxWindow::FromPhys(). + + @param window Non-null and fully created window. + */ + wxSize GetPreferredLogicalSizeFor(const wxWindow* window) const; /** Get bitmap of the specified size, creating a new bitmap from the closest @@ -325,8 +337,8 @@ public: Get bitmap of the size appropriate for the DPI scaling used by the given window. - This helper function simply combines GetBitmap() and - GetPreferredSizeFor(), i.e. it returns a (normally unscaled) bitmap + This helper function simply combines GetPreferredBitmapSizeFor() and + GetBitmap(), i.e. it returns a (normally unscaled) bitmap from the bundle of the closest size to the size that should be used at the DPI scaling of the provided window. @@ -384,7 +396,7 @@ public: ... determine the minimum/default size for bitmap to use ... } - wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE + wxSize GetPreferredBitmapSizeAtScale(double scale) const wxOVERRIDE { // If it's ok to scale the bitmap, just use the standard size // at the given scale: @@ -428,7 +440,7 @@ public: Must always return a valid size. */ - virtual wxSize GetPreferredSizeAtScale(double scale) const = 0; + virtual wxSize GetPreferredBitmapSizeAtScale(double scale) const = 0; /** Retrieve the bitmap of exactly the given size. diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 41c5fb73a3..357d39b082 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -520,7 +520,7 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar) return m_sizeDef; } - wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE + wxSize GetPreferredBitmapSizeAtScale(double scale) const wxOVERRIDE { // We just scale the bitmap to fit the requested size, so // we don't really have any preferences. diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index db0d5c94cf..283909a898 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -1015,7 +1015,7 @@ void MyTreeCtrl::CreateImages(int size) return m_sizeDef; } - wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE + wxSize GetPreferredBitmapSizeAtScale(double scale) const wxOVERRIDE { return m_sizeDef*scale; } diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 7f569fda9f..e1f8a18c40 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -410,7 +410,7 @@ void wxAuiGenericToolBarArt::DrawDropDownButton( - const wxSize sizeDropDown = m_buttonDropDownBmp.GetPreferredSizeFor(wnd); + const wxSize sizeDropDown = m_buttonDropDownBmp.GetPreferredLogicalSizeFor(wnd); dropBmpX = dropDownRect.x + (dropDownRect.width/2) - (sizeDropDown.x/2); diff --git a/src/aui/dockart.cpp b/src/aui/dockart.cpp index f4e6075537..83784ffdcd 100644 --- a/src/aui/dockart.cpp +++ b/src/aui/dockart.cpp @@ -685,7 +685,7 @@ wxAuiDefaultDockArt::DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wx } // Ensure the icon fits into the title bar. - wxSize iconSize = pane.icon.GetPreferredSizeFor(window); + wxSize iconSize = pane.icon.GetPreferredLogicalSizeFor(window); if (iconSize.y > rect.height) { iconSize *= static_cast(rect.height) / iconSize.y; @@ -693,7 +693,7 @@ wxAuiDefaultDockArt::DrawIcon(wxDC& dc, wxWindow *window, const wxRect& rect, wx // Draw the icon centered vertically int xOffset = window->FromDIP(2); - const wxBitmap& icon = pane.icon.GetBitmap(iconSize); + const wxBitmap& icon = pane.icon.GetBitmap(window->ToPhys(iconSize)); dc.DrawBitmap(icon, rect.x+xOffset, rect.y+(rect.height-icon.GetLogicalHeight())/2, true); diff --git a/src/aui/tabart.cpp b/src/aui/tabart.cpp index 4d8ee85834..e3f7368751 100644 --- a/src/aui/tabart.cpp +++ b/src/aui/tabart.cpp @@ -248,9 +248,9 @@ void wxAuiGenericTabArt::SetSizingInfo(const wxSize& tab_ctrl_size, int tot_width = (int)tab_ctrl_size.x - GetIndentSize() - wnd->FromDIP(4); if (m_flags & wxAUI_NB_CLOSE_BUTTON) - tot_width -= wnd->FromPhys(m_activeCloseBmp.GetPreferredSizeFor(wnd).x); + tot_width -= m_activeCloseBmp.GetPreferredLogicalSizeFor(wnd).x; if (m_flags & wxAUI_NB_WINDOWLIST_BUTTON) - tot_width -= wnd->FromPhys(m_activeWindowListBmp.GetPreferredSizeFor(wnd).x); + tot_width -= m_activeWindowListBmp.GetPreferredLogicalSizeFor(wnd).x; if (tab_count > 0) { @@ -705,7 +705,7 @@ wxSize wxAuiGenericTabArt::GetTabSize(wxDC& dc, { // we need the correct size of the bitmap to be used on this window in // logical dimensions for drawing - const wxSize bitmapSize = wnd->FromPhys(bitmap.GetPreferredSizeFor(wnd)); + const wxSize bitmapSize = bitmap.GetPreferredLogicalSizeFor(wnd); // increase by bitmap plus right side bitmap padding tab_width += bitmapSize.x + wnd->FromDIP(3); diff --git a/src/aui/tabartmsw.cpp b/src/aui/tabartmsw.cpp index 2c62ad9230..2ebda36065 100644 --- a/src/aui/tabartmsw.cpp +++ b/src/aui/tabartmsw.cpp @@ -306,7 +306,7 @@ wxSize wxAuiMSWTabArt::GetTabSize(wxDC& dc, // if there's a bitmap, add space for it if ( bitmap.IsOk() ) { - const wxSize bitmapSize = wnd->FromPhys(bitmap.GetPreferredSizeFor(wnd)); + const wxSize bitmapSize = bitmap.GetPreferredLogicalSizeFor(wnd); tabWidth += bitmapSize.x + wnd->FromDIP(3); // bitmap padding tabHeight = wxMax(tabHeight, bitmapSize.y + wnd->FromDIP(2)); diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index c2a59ce32b..982afd50b3 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -162,7 +162,7 @@ public: return m_sizeDefault; } - virtual wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE + virtual wxSize GetPreferredBitmapSizeAtScale(double scale) const wxOVERRIDE { // We have no preferred sizes. return m_sizeDefault*scale; diff --git a/src/common/bmpbndl.cpp b/src/common/bmpbndl.cpp index d5dd897ae5..c2b66b3ea7 100644 --- a/src/common/bmpbndl.cpp +++ b/src/common/bmpbndl.cpp @@ -63,7 +63,7 @@ public: } virtual wxSize GetDefaultSize() const wxOVERRIDE; - virtual wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE; + virtual wxSize GetPreferredBitmapSizeAtScale(double scale) const wxOVERRIDE; virtual wxBitmap GetBitmap(const wxSize& size) wxOVERRIDE; private: @@ -169,7 +169,7 @@ wxSize wxBitmapBundleImplSet::GetDefaultSize() const return m_sizeDefault; } -wxSize wxBitmapBundleImplSet::GetPreferredSizeAtScale(double scale) const +wxSize wxBitmapBundleImplSet::GetPreferredBitmapSizeAtScale(double scale) const { // Target size is the ideal size we'd like the bitmap to have at this scale. const wxSize sizeTarget = GetDefaultSize()*scale; @@ -429,19 +429,26 @@ wxSize wxBitmapBundle::GetDefaultSize() const return m_impl->GetDefaultSize(); } -wxSize wxBitmapBundle::GetPreferredSizeFor(const wxWindow* window) const +wxSize wxBitmapBundle::GetPreferredBitmapSizeFor(const wxWindow* window) const { wxCHECK_MSG( window, wxDefaultSize, "window must be valid" ); - return GetPreferredSizeAtScale(window->GetDPIScaleFactor()); + return GetPreferredBitmapSizeAtScale(window->GetDPIScaleFactor()); } -wxSize wxBitmapBundle::GetPreferredSizeAtScale(double scale) const +wxSize wxBitmapBundle::GetPreferredLogicalSizeFor(const wxWindow* window) const +{ + wxCHECK_MSG( window, wxDefaultSize, "window must be valid" ); + + return window->FromPhys(GetPreferredBitmapSizeAtScale(window->GetDPIScaleFactor())); +} + +wxSize wxBitmapBundle::GetPreferredBitmapSizeAtScale(double scale) const { if ( !m_impl ) return wxDefaultSize; - return m_impl->GetPreferredSizeAtScale(scale); + return m_impl->GetPreferredBitmapSizeAtScale(scale); } wxBitmap wxBitmapBundle::GetBitmap(const wxSize& size) const @@ -474,12 +481,12 @@ wxIcon wxBitmapBundle::GetIcon(const wxSize& size) const wxBitmap wxBitmapBundle::GetBitmapFor(const wxWindow* window) const { - return GetBitmap(GetPreferredSizeFor(window)); + return GetBitmap(GetPreferredBitmapSizeFor(window)); } wxIcon wxBitmapBundle::GetIconFor(const wxWindow* window) const { - return GetIcon(GetPreferredSizeFor(window)); + return GetIcon(GetPreferredBitmapSizeFor(window)); } namespace @@ -530,7 +537,7 @@ wxBitmapBundle::GetConsensusSizeFor(wxWindow* win, SizePrefs prefs; for ( size_t n = 0; n < bundles.size(); ++n ) { - RecordSizePref(prefs, bundles[n].GetPreferredSizeAtScale(scale)); + RecordSizePref(prefs, bundles[n].GetPreferredBitmapSizeAtScale(scale)); } // Now find the size preferred by most tools. diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 027b460223..df55b0fbdc 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -2221,7 +2221,7 @@ bool wxDataViewCheckIconTextRenderer::Render(wxRect cell, wxDC* dc, int state) const bool drawIcon = bb.IsOk(); if ( drawIcon ) { - const wxSize sizeIcon = bb.GetPreferredSizeFor(GetView()); + const wxSize sizeIcon = bb.GetPreferredLogicalSizeFor(GetView()); rectIcon = wxRect(cell.GetPosition(), sizeIcon); rectIcon.x += xoffset; rectIcon = rectIcon.CentreIn(cell, wxVERTICAL); diff --git a/src/common/statbmpcmn.cpp b/src/common/statbmpcmn.cpp index 1741c471e8..a5eec2dcc0 100644 --- a/src/common/statbmpcmn.cpp +++ b/src/common/statbmpcmn.cpp @@ -92,7 +92,7 @@ wxStaticBitmapBase::~wxStaticBitmapBase() wxSize wxStaticBitmapBase::DoGetBestSize() const { if ( m_bitmapBundle.IsOk() ) - return FromPhys(m_bitmapBundle.GetPreferredSizeFor(this)); + return m_bitmapBundle.GetPreferredLogicalSizeFor(this); // the fall back size is completely arbitrary return wxSize(16, 16); diff --git a/src/generic/bmpsvg.cpp b/src/generic/bmpsvg.cpp index 9f146c8b3e..d3c5f030f9 100644 --- a/src/generic/bmpsvg.cpp +++ b/src/generic/bmpsvg.cpp @@ -108,7 +108,7 @@ public: } virtual wxSize GetDefaultSize() const wxOVERRIDE; - virtual wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE; + virtual wxSize GetPreferredBitmapSizeAtScale(double scale) const wxOVERRIDE; virtual wxBitmap GetBitmap(const wxSize& size) wxOVERRIDE; private: @@ -142,7 +142,7 @@ wxSize wxBitmapBundleImplSVG::GetDefaultSize() const return m_sizeDef; } -wxSize wxBitmapBundleImplSVG::GetPreferredSizeAtScale(double scale) const +wxSize wxBitmapBundleImplSVG::GetPreferredBitmapSizeAtScale(double scale) const { // We consider that we can render at any scale. return m_sizeDef*scale; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index bcc624b81b..3abe191aa0 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -1577,7 +1577,7 @@ wxSize wxDataViewIconTextRenderer::GetSize() const const wxBitmapBundle& bb = m_value.GetBitmapBundle(); if (bb.IsOk()) - size.x += bb.GetPreferredSizeFor(dvc).x + dvc->FromDIP(4); + size.x += bb.GetPreferredLogicalSizeFor(dvc).x + dvc->FromDIP(4); return size; } return dvc->FromDIP(wxSize(80,20)); @@ -1596,7 +1596,7 @@ wxWindow* wxDataViewIconTextRenderer::CreateEditorCtrl(wxWindow *parent, wxRect { wxWindow* const dvc = GetView(); - int w = bb.GetPreferredSizeFor(dvc).x + dvc->FromDIP(4); + int w = bb.GetPreferredLogicalSizeFor(dvc).x + dvc->FromDIP(4); labelRect.x += w; labelRect.width -= w; } diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index fd05bd5c24..588aed041d 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -108,7 +108,7 @@ public: wxButtonImageData(wxWindow* btn, const wxBitmapBundle& normalBundle) : m_btn(btn) { - m_bitmapSize = normalBundle.GetPreferredSizeFor(btn); + m_bitmapSize = normalBundle.GetPreferredBitmapSizeFor(btn); m_bitmapBundles[wxAnyButton::State_Normal] = normalBundle; @@ -125,7 +125,7 @@ public: { event.Skip(); - m_bitmapSize = m_bitmapBundles[wxAnyButton::State_Normal].GetPreferredSizeFor(m_btn); + m_bitmapSize = m_bitmapBundles[wxAnyButton::State_Normal].GetPreferredBitmapSizeFor(m_btn); } // Bitmap can be set either explicitly, when the bitmap for the given state diff --git a/src/msw/bmpbndl.cpp b/src/msw/bmpbndl.cpp index 4380df8f14..12dfce9997 100644 --- a/src/msw/bmpbndl.cpp +++ b/src/msw/bmpbndl.cpp @@ -138,7 +138,7 @@ public: const wxBitmap& bitmap); virtual wxSize GetDefaultSize() const wxOVERRIDE; - virtual wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE; + virtual wxSize GetPreferredBitmapSizeAtScale(double scale) const wxOVERRIDE; virtual wxBitmap GetBitmap(const wxSize& size) wxOVERRIDE; private: @@ -186,7 +186,7 @@ wxSize wxBitmapBundleImplRC::GetDefaultSize() const return m_bitmaps[0].GetSize(); } -wxSize wxBitmapBundleImplRC::GetPreferredSizeAtScale(double scale) const +wxSize wxBitmapBundleImplRC::GetPreferredBitmapSizeAtScale(double scale) const { // Optimistically assume we're going to use this exact scale by default. double scalePreferred = scale; diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index dffa7835d5..ff28e60cca 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -109,7 +109,7 @@ WXDWORD wxStaticBitmap::MSWGetStyle(long style, WXDWORD *exstyle) const wxSize wxStaticBitmap::GetImageSize() const { return m_icon.IsOk() ? m_icon.GetSize() - : m_bitmapBundle.GetPreferredSizeFor(this); + : m_bitmapBundle.GetPreferredBitmapSizeFor(this); } void wxStaticBitmap::SetIcon(const wxIcon& icon) diff --git a/src/osx/core/bmpbndl.mm b/src/osx/core/bmpbndl.mm index f2052790bd..72e5ec007e 100644 --- a/src/osx/core/bmpbndl.mm +++ b/src/osx/core/bmpbndl.mm @@ -113,7 +113,7 @@ public: ~wxOSXImageBundleImpl(); virtual wxSize GetDefaultSize() const wxOVERRIDE; - virtual wxSize GetPreferredSizeAtScale(double scale) const wxOVERRIDE; + virtual wxSize GetPreferredBitmapSizeAtScale(double scale) const wxOVERRIDE; virtual wxBitmap GetBitmap(const wxSize& size) wxOVERRIDE; }; @@ -138,7 +138,7 @@ wxSize wxOSXImageBundleImpl::GetDefaultSize() const return wxSize(sz.width, sz.height); } -wxSize wxOSXImageBundleImpl::GetPreferredSizeAtScale(double scale) const +wxSize wxOSXImageBundleImpl::GetPreferredBitmapSizeAtScale(double scale) const { // The system always performs scaling, as the scaling factor is integer and // so it doesn't make sense to round it up or down, hence we should use the @@ -253,7 +253,7 @@ WXImage wxOSXGetImageFromBundle(const wxBitmapBundle& bundle) image = wxOSXImageFromBitmap(bmp); // unconditionally try to add a 2x version, if there really is a different one - wxSize doublesz = impl->GetPreferredSizeAtScale(2.0); + wxSize doublesz = impl->GetPreferredBitmapSizeAtScale(2.0); if ( doublesz != sz ) { bmp = const_cast(impl)->GetBitmap(doublesz); diff --git a/tests/graphics/bmpbundle.cpp b/tests/graphics/bmpbundle.cpp index 3d723bb0f6..9ea96f37c8 100644 --- a/tests/graphics/bmpbundle.cpp +++ b/tests/graphics/bmpbundle.cpp @@ -49,7 +49,7 @@ TEST_CASE("BitmapBundle::FromBitmaps", "[bmpbundle]") TEST_CASE("BitmapBundle::GetPreferredSize", "[bmpbundle]") { - CHECK( wxBitmapBundle().GetPreferredSizeAtScale(1) == wxDefaultSize ); + CHECK( wxBitmapBundle().GetPreferredBitmapSizeAtScale(1) == wxDefaultSize ); const wxSize normal(32, 32); const wxSize bigger(64, 64); @@ -59,18 +59,18 @@ TEST_CASE("BitmapBundle::GetPreferredSize", "[bmpbundle]") // Check that the existing bitmaps are used without scaling for most of the // typical scaling values. - CHECK( b.GetPreferredSizeAtScale(0 ) == normal ); - CHECK( b.GetPreferredSizeAtScale(1 ) == normal ); - CHECK( b.GetPreferredSizeAtScale(1.25) == normal ); - CHECK( b.GetPreferredSizeAtScale(1.4 ) == normal ); - CHECK( b.GetPreferredSizeAtScale(1.5 ) == bigger ); - CHECK( b.GetPreferredSizeAtScale(1.75) == bigger ); - CHECK( b.GetPreferredSizeAtScale(2 ) == bigger ); - CHECK( b.GetPreferredSizeAtScale(2.5 ) == bigger ); + CHECK( b.GetPreferredBitmapSizeAtScale(0 ) == normal ); + CHECK( b.GetPreferredBitmapSizeAtScale(1 ) == normal ); + CHECK( b.GetPreferredBitmapSizeAtScale(1.25) == normal ); + CHECK( b.GetPreferredBitmapSizeAtScale(1.4 ) == normal ); + CHECK( b.GetPreferredBitmapSizeAtScale(1.5 ) == bigger ); + CHECK( b.GetPreferredBitmapSizeAtScale(1.75) == bigger ); + CHECK( b.GetPreferredBitmapSizeAtScale(2 ) == bigger ); + CHECK( b.GetPreferredBitmapSizeAtScale(2.5 ) == bigger ); // This scale is too big to use any of the existing bitmaps, so they will // be scaled. - CHECK( b.GetPreferredSizeAtScale(3 ) == 3*normal ); + CHECK( b.GetPreferredBitmapSizeAtScale(3 ) == 3*normal ); } #ifdef wxHAS_DPI_INDEPENDENT_PIXELS