X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/20e6714a67e1188b9bbb8ca2bc0fb6321e2864fc..d642db66a5efc82d374b813022c72ba88bc50839:/include/wx/bitmap.h?ds=sidebyside diff --git a/include/wx/bitmap.h b/include/wx/bitmap.h index 82943ca228..06824a2c27 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 @@ -89,7 +90,7 @@ protected: // Unfortunately, currently wxBitmap does not inherit from wxBitmapBase on all // platforms and this is not easy to fix. So we extract at least some common -// methods into this class from which both wxBitmapBase (and hase wxBitmap on +// methods into this class from which both wxBitmapBase (and hence wxBitmap on // all platforms where it does inherit from it) and wxBitmap in wxMSW and other // exceptional ports (only wxPM and old wxCocoa) inherit. class WXDLLIMPEXP_CORE wxBitmapHelpers @@ -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; + virtual bool CreateScaled(int w, int h, int d, double logicalScale) + { return Create(w*logicalScale,h*logicalScale,d); } virtual int GetHeight() const = 0; virtual int GetWidth() const = 0; @@ -182,6 +185,13 @@ public: wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); } + // support for scaled bitmaps + 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()); } + #if wxUSE_IMAGE virtual wxImage ConvertToImage() const = 0;