X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/20e6714a67e1188b9bbb8ca2bc0fb6321e2864fc..ccaf2891c9082773460c50c7eb7a910ea51e7003:/include/wx/msw/bitmap.h diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h index ef2a73fb27..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; @@ -160,7 +163,6 @@ public: #endif // wxUSE_PALETTE wxMask *GetMask() const; - wxBitmap GetMaskBitmap() const; void SetMask(wxMask *mask); // these functions are internal and shouldn't be used, they risk to @@ -168,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 // ------------------------------- @@ -238,6 +247,8 @@ public: bool Create(const wxBitmap& bitmap, int paletteIndex); bool Create(const wxBitmap& bitmap); + wxBitmap GetBitmap() const; + // Implementation WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; } void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; }