From a85ccd79fdfe15dbe412e9b1cb78a8047e6b7a83 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 25 Jun 2013 13:54:15 +0000 Subject: [PATCH] fixing naming to GetScaleFactor, adding default Create with a dc parameter git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/bitmap.h | 9 ++++++--- src/common/bmpbase.cpp | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/include/wx/bitmap.h b/include/wx/bitmap.h index 791b721d22..c6eceb596c 100644 --- a/include/wx/bitmap.h +++ b/include/wx/bitmap.h @@ -26,6 +26,7 @@ class WXDLLIMPEXP_FWD_CORE wxBitmapHandler; class WXDLLIMPEXP_FWD_CORE wxIcon; class WXDLLIMPEXP_FWD_CORE wxMask; class WXDLLIMPEXP_FWD_CORE wxPalette; +class WXDLLIMPEXP_FWD_CORE wxDC; // ---------------------------------------------------------------------------- // wxVariant support @@ -174,6 +175,8 @@ public: virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) = 0; virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) = 0; + // Create a bitmap compatible with the given DC, inheriting its magnification factor + virtual bool Create(int width, int height, const wxDC& dc); virtual int GetHeight() const = 0; virtual int GetWidth() const = 0; @@ -183,9 +186,9 @@ public: { return wxSize(GetWidth(), GetHeight()); } // support for scaled bitmaps - virtual double GetScale() const { return 1.0; } - virtual double GetScaledWidth() const { return GetWidth() / GetScale(); } - virtual double GetScaledHeight() const { return GetHeight() / GetScale(); } + virtual double GetScaleFactor() const { return 1.0; } + virtual double GetScaledWidth() const { return GetWidth() / GetScaleFactor(); } + virtual double GetScaledHeight() const { return GetHeight() / GetScaleFactor(); } virtual wxSize GetScaledSize() const { return wxSize(GetScaledWidth(), GetScaledHeight()); } diff --git a/src/common/bmpbase.cpp b/src/common/bmpbase.cpp index 46804febbd..1a0c5d7809 100644 --- a/src/common/bmpbase.cpp +++ b/src/common/bmpbase.cpp @@ -87,6 +87,11 @@ IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxObject) wxList wxBitmapBase::sm_handlers; +bool wxBitmapBase::Create(int width, int height, const wxDC& WXUNUSED(dc)) +{ + return Create(width,height); +} + void wxBitmapBase::AddHandler(wxBitmapHandler *handler) { sm_handlers.Append(handler); -- 2.45.2