Applied John L's patches for curson scaling, image resizing

without scaling and the art provider resize bitmap patch.
    I'll look into adapting the generic file dialog to it.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32598 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2005-03-04 18:33:57 +00:00
parent 0b40f3d80b
commit b737ad10de
14 changed files with 334 additions and 44 deletions

View File

@@ -137,6 +137,10 @@ public:
const wxArtClient& client = wxART_OTHER,
const wxSize& size = wxDefaultSize);
// Get the size of an icon from a specific wxArtClient, queries
// the topmost provider if platform_dependent = false
static wxSize GetSize(const wxArtClient& client, bool platform_dependent = false);
protected:
friend class wxArtProviderModule;
// Initializes default provider
@@ -146,6 +150,12 @@ protected:
// Destroy caches & all providers
static void CleanUpProviders();
// Get the default size of an icon for a specific client
virtual wxSize DoGetSize(const wxArtClient& client)
{
return GetSize(client, true);
}
// Derived classes must override this method to create requested
// art resource. This method is called only once per instance's
// lifetime for each requested wxArtID.

View File

@@ -346,6 +346,8 @@ public:
wxSize GetSize() const { return wxSize(width, height); }
void SetSize( const wxSize &s ) { width = s.GetWidth(); height = s.GetHeight(); }
bool IsEmpty() const { return (width <= 0) || (height <= 0); }
wxPoint GetTopLeft() const { return GetPosition(); }
wxPoint GetLeftTop() const { return GetTopLeft(); }
void SetTopLeft(const wxPoint &p) { SetPosition(p); }

View File

@@ -178,7 +178,14 @@ public:
wxImage Copy() const;
// return the new image with size width*height
wxImage GetSubImage( const wxRect& ) const;
wxImage GetSubImage( const wxRect& rect) const;
// Paste the image or part of this image into an image of the given size at the pos
// any newly exposed areas will be filled with the rgb colour
// by default if r = g = b = -1 then fill with this image's mask colour or find and
// set a suitable mask colour
wxImage Size( const wxSize& size, const wxPoint& pos,
int r = -1, int g = -1, int b = -1 ) const;
// pastes image into this instance and takes care of
// the mask colour and out of bounds problems
@@ -192,6 +199,10 @@ public:
// rescales the image in place
wxImage& Rescale( int width, int height ) { return *this = Scale(width, height); }
// resizes the image in place
wxImage& Resize( const wxSize& size, const wxPoint& pos,
int r = -1, int g = -1, int b = -1 ) { return *this = Size(size, pos, r, g, b); }
// Rotates the image about the given point, 'angle' radians.
// Returns the rotated image, leaving this image intact.
wxImage Rotate(double angle, const wxPoint & centre_of_rotation,
@@ -210,6 +221,7 @@ public:
// these routines are slow but safe
void SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b );
void SetRGB( const wxRect& rect, unsigned char r, unsigned char g, unsigned char b );
unsigned char GetRed( int x, int y ) const;
unsigned char GetGreen( int x, int y ) const;
unsigned char GetBlue( int x, int y ) const;
@@ -280,6 +292,9 @@ public:
// Mask functions
void SetMaskColour( unsigned char r, unsigned char g, unsigned char b );
// Get the current mask colour or find a suitable colour
// returns true if using current mask colour
bool GetOrFindMaskColour( unsigned char *r, unsigned char *g, unsigned char *b ) const;
unsigned char GetMaskRed() const;
unsigned char GetMaskGreen() const;
unsigned char GetMaskBlue() const;