From c74b07ac26d4e7624ec7a7115bbade0cf3336c13 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Fri, 28 Nov 2008 22:29:29 +0000 Subject: [PATCH] provide GetSize() getters in wxBitmap and wxImage git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/bitmap.h | 3 +++ include/wx/image.h | 3 +++ interface/wx/bitmap.h | 13 ++++++++++++- interface/wx/image.h | 13 ++++++++++++- 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/wx/bitmap.h b/include/wx/bitmap.h index b78cc41a36..f6fd27635e 100644 --- a/include/wx/bitmap.h +++ b/include/wx/bitmap.h @@ -161,6 +161,9 @@ public: virtual int GetWidth() const = 0; virtual int GetDepth() const = 0; + wxSize GetSize() const + { return wxSize(GetWidth(), GetHeight()); } + #if wxUSE_IMAGE virtual wxImage ConvertToImage() const = 0; #endif // wxUSE_IMAGE diff --git a/include/wx/image.h b/include/wx/image.h index ffb1e3777b..84dcd3934d 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -361,6 +361,9 @@ public: int GetWidth() const; int GetHeight() const; + wxSize GetSize() const + { return wxSize(GetWidth(), GetHeight()); } + // Gets the type of image found by LoadFile or specified with SaveFile wxBitmapType GetType() const; diff --git a/interface/wx/bitmap.h b/interface/wx/bitmap.h index 68c3ed8bc5..3d1ec2000e 100644 --- a/interface/wx/bitmap.h +++ b/interface/wx/bitmap.h @@ -440,6 +440,8 @@ public: /** Gets the height of the bitmap in pixels. + + @see GetWidth(), GetSize() */ virtual int GetHeight() const; @@ -465,10 +467,19 @@ public: */ virtual wxBitmap GetSubBitmap(const wxRect& rect) const; + /** + Returns the size of the bitmap in pixels. + + @since 2.9.0 + + @see GetHeight(), GetWidth() + */ + wxSize GetSize() const; + /** Gets the width of the bitmap in pixels. - @see GetHeight() + @see GetHeight(), GetSize() */ virtual int GetWidth() const; diff --git a/interface/wx/image.h b/interface/wx/image.h index 67710f92e4..4358c0e4da 100644 --- a/interface/wx/image.h +++ b/interface/wx/image.h @@ -705,6 +705,8 @@ public: /** Gets the height of the image in pixels. + + @see GetWidth(), GetSize() */ int GetHeight() const; @@ -876,6 +878,15 @@ public: */ wxImage GetSubImage(const wxRect& rect) const; + /** + Returns the size of the image in pixels. + + @since 2.9.0 + + @see GetHeight(), GetWidth() + */ + wxSize GetSize() const; + /** Gets the type of image found by LoadFile() or specified with SaveFile(). @@ -886,7 +897,7 @@ public: /** Gets the width of the image in pixels. - @see GetHeight() + @see GetHeight(), GetSize() */ int GetWidth() const;