From cf0a18448029b7e09e74a131c86dea05931b25fa Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 25 Jun 2013 17:37:17 +0000 Subject: [PATCH] adding impls to wxBitmap on msw as this doesn't inherit from base - Thanks Vaclav! git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/bitmap.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index 6af2d21627..f4e6cb4f78 100644 --- a/include/wx/msw/bitmap.h +++ b/include/wx/msw/bitmap.h @@ -144,6 +144,9 @@ public: virtual bool Create(int width, int height, const wxDC& dc); virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1); + virtual bool CreateScaled(int w, int h, int d, double logicalScale) + { return Create(w*logicalScale,h*logicalScale,d); } + virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE); virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; @@ -167,6 +170,13 @@ public: bool HasAlpha() const; void UseAlpha(); + // 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()); } + // implementation only from now on // ------------------------------- -- 2.45.2