From b258d02be35482b3e48f22468646543475e8ca7d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 23 Oct 2021 21:10:50 +0200 Subject: [PATCH] Document wxBitmap::GetScaleFactor() and related methods These methods were added 8+ years ago but never documented for some reason, finally do it now. --- interface/wx/bitmap.h | 61 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/interface/wx/bitmap.h b/interface/wx/bitmap.h index da167982f1..0456114c2b 100644 --- a/interface/wx/bitmap.h +++ b/interface/wx/bitmap.h @@ -551,7 +551,7 @@ public: /** Gets the height of the bitmap in pixels. - @see GetWidth(), GetSize() + @see GetWidth(), GetSize(), GetScaledHeight() */ virtual int GetHeight() const; @@ -577,19 +577,74 @@ public: */ virtual wxBitmap GetSubBitmap(const wxRect& rect) const; + /** + Returns the scale factor of this bitmap. + + Scale factor is 1 by default, but can be greater to indicate that the + size of bitmap in logical, DPI-independent pixels is smaller than its + actual size in physical pixels. Bitmaps with scale factor greater than + 1 must be used in high DPI to appear sharp on the screen. + + Note that the scale factor is only used in the ports where logical + pixels are not the same as physical ones, such as wxOSX or wxGTK3. + + @see GetScaledWidth(), GetScaledHeight(), GetScaledSize() + + @since 2.9.5 + */ + virtual double GetScaleFactor() const; + + /** + Returns the scaled height of the bitmap. + + See GetScaledSize() for more information. + + @see GetScaledWidth(), GetHeight() + + @since 2.9.5 + */ + virtual double GetScaledHeight() const; + + /** + Returns the scaled size of the bitmap. + + The scaled size of the bitmap is its size in pixels, as returned by + GetSize(), divided by its scale factor, as returned by + GetScaleFactor(), and so is the same as the normal size for bitmaps + with the default scale factor of 1 and always less than the physical + size for the higher resolution bitmaps supposed to be used on high DPI + screens. + + @see GetScaledWidth(), GetScaledHeight(), GetSize() + + @since 2.9.5 + */ + virtual wxSize GetScaledSize() const; + + /** + Returns the scaled width of the bitmap. + + See GetScaledSize() for more information. + + @see GetScaledHeight(), GetWidth() + + @since 2.9.5 + */ + virtual double GetScaledWidth() const; + /** Returns the size of the bitmap in pixels. @since 2.9.0 - @see GetHeight(), GetWidth() + @see GetHeight(), GetWidth(), GetScaledSize() */ wxSize GetSize() const; /** Gets the width of the bitmap in pixels. - @see GetHeight(), GetSize() + @see GetHeight(), GetSize(), GetScaledWidth() */ virtual int GetWidth() const;