made wxImage::Scale() const to not confuse people any more and added

a Rescale() which changes the image size "in place". Documented both
changes too.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-07-05 21:08:29 +00:00
parent a0bc2c1d27
commit ce9a75d225
3 changed files with 55 additions and 14 deletions

View File

@@ -195,13 +195,18 @@ public:
// these functions get implemented in /src/(platform)/bitmap.cpp
wxImage( const wxBitmap &bitmap );
operator wxBitmap() const { return ConvertToBitmap(); }
wxBitmap ConvertToBitmap() const;
void Create( int width, int height );
void Destroy();
wxImage Scale( int width, int height );
// return the new image with size width*height
wxImage Scale( int width, int height ) const;
// rescales the image in place
wxImage Rescale( int width, int height ) { *this = Scale(width, height); }
// these routines are slow but safe
void SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b );
unsigned char GetRed( int x, int y );
@@ -238,18 +243,19 @@ public:
void SetMask( bool mask = TRUE );
bool HasMask() const;
inline wxImage& operator = (const wxImage& image)
{ if ((*this) == image)
return (*this);
wxImage& operator = (const wxImage& image)
{
if ( (*this) != image )
Ref(image);
return *this; }
return *this;
}
inline bool operator == (const wxImage& image)
bool operator == (const wxImage& image)
{ return m_refData == image.m_refData; }
inline bool operator != (const wxImage& image)
bool operator != (const wxImage& image)
{ return m_refData != image.m_refData; }
static inline wxList& GetHandlers() { return sm_handlers; }
static wxList& GetHandlers() { return sm_handlers; }
static void AddHandler( wxImageHandler *handler );
static void InsertHandler( wxImageHandler *handler );
static bool RemoveHandler( const wxString& name );