Add wxBitmap::SetScaleFactor()
We need to be able to change the scale factor of the bitmaps returned by wxBitmapBundle::GetBitmap(), so add a function allowing to do this. Also add wxHAS_BITMAP_SCALE_FACTOR allowing to check whether this function actually does something non-trivial and explain in the docs that GetScaleFactor() always returns 1 on the platforms where this symbol is not defined.
This commit is contained in:
@@ -75,6 +75,8 @@ public:
|
||||
int GetBytesPerRow() const;
|
||||
bool HasAlpha() const;
|
||||
WXImage GetImage() const;
|
||||
|
||||
void SetScaleFactor(double scale) { m_scaleFactor = scale; }
|
||||
double GetScaleFactor() const { return m_scaleFactor; }
|
||||
|
||||
const void *GetRawAccess() const;
|
||||
@@ -1389,6 +1391,13 @@ int wxBitmap::GetWidth() const
|
||||
return GetBitmapData()->GetWidth() ;
|
||||
}
|
||||
|
||||
void wxBitmap::SetScaleFactor(double scale)
|
||||
{
|
||||
wxCHECK_RET( IsOk(), wxT("invalid bitmap") );
|
||||
|
||||
return GetBitmapData()->SetScaleFactor(scale) ;
|
||||
}
|
||||
|
||||
double wxBitmap::GetScaleFactor() const
|
||||
{
|
||||
wxCHECK_MSG( IsOk(), -1, wxT("invalid bitmap") );
|
||||
|
||||
Reference in New Issue
Block a user