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
This commit is contained in:
Stefan Csomor 2013-06-25 13:54:15 +00:00
parent 9afa58e3b9
commit a85ccd79fd
2 changed files with 11 additions and 3 deletions

View File

@ -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()); }

View File

@ -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);