Add wxStaticBitmap::SetScaleMode() to control bitmap display size
This allows a bitmap to scale with the size of the wxStaticBitmap control. Scaling can be controlled to fill the control with or without changing the bitmaps aspect ratio.
This commit is contained in:
committed by
Vadim Zeitlin
parent
9c95b398c8
commit
58c7e6d54f
@@ -56,6 +56,13 @@ public:
|
||||
wxIcon GetIcon() const wxOVERRIDE { return (const wxIcon &)m_bitmap; }
|
||||
#endif
|
||||
|
||||
virtual void SetScaleMode(ScaleMode scaleMode) wxOVERRIDE
|
||||
{
|
||||
m_scaleMode = scaleMode;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
virtual ScaleMode GetScaleMode() const wxOVERRIDE { return m_scaleMode; }
|
||||
|
||||
private:
|
||||
wxSize GetBitmapSize()
|
||||
@@ -67,6 +74,7 @@ private:
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
wxBitmap m_bitmap;
|
||||
ScaleMode m_scaleMode;
|
||||
|
||||
wxDECLARE_DYNAMIC_CLASS(wxGenericStaticBitmap);
|
||||
};
|
||||
|
Reference in New Issue
Block a user