diff --git a/include/wx/gtk/bitmap.h b/include/wx/gtk/bitmap.h index 63283c2554..2919fc80d9 100644 --- a/include/wx/gtk/bitmap.h +++ b/include/wx/gtk/bitmap.h @@ -83,11 +83,13 @@ public: bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) wxOVERRIDE; bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) wxOVERRIDE { return Create(sz.GetWidth(), sz.GetHeight(), depth); } - bool Create(int width, int height, const wxDC& WXUNUSED(dc)) - { return Create(width,height); } #ifdef __WXGTK3__ + bool Create(int width, int height, const wxDC& dc); virtual void SetScaleFactor(double scale) wxOVERRIDE; virtual double GetScaleFactor() const wxOVERRIDE; +#else + bool Create(int width, int height, const wxDC& WXUNUSED(dc)) + { return Create(width,height); } #endif virtual int GetHeight() const wxOVERRIDE; diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 488fc4c7f4..095b09b78c 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -21,6 +21,10 @@ #include "wx/math.h" #include "wx/rawbmp.h" +#ifdef __WXGTK3__ +#include "wx/dc.h" +#endif + #include "wx/gtk/private/object.h" #include "wx/gtk/private.h" @@ -990,6 +994,13 @@ void wxBitmap::SetMask( wxMask *mask ) } #ifdef __WXGTK3__ +bool wxBitmap::Create(int width, int height, const wxDC& dc) +{ + return DoCreate(wxSize(width, height), + dc.GetContentScaleFactor(), + wxBITMAP_SCREEN_DEPTH); +} + bool wxBitmap::DoCreate(const wxSize& size, double scale, int depth) { Create(size*scale, depth);