Use wxBitmap::Rescale() in wxGenericStaticBitmap code
No real changes, just reuse the existing function instead of redoing it one more time.
This commit is contained in:
@@ -55,7 +55,7 @@ void wxGenericStaticBitmap::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
if ( !drawSize.x || !drawSize.y )
|
if ( !drawSize.x || !drawSize.y )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const wxBitmap bitmap = GetBitmap();
|
wxBitmap bitmap = GetBitmap();
|
||||||
const wxSize bmpSize = bitmap.GetSize();
|
const wxSize bmpSize = bitmap.GetSize();
|
||||||
wxDouble w = 0;
|
wxDouble w = 0;
|
||||||
wxDouble h = 0;
|
wxDouble h = 0;
|
||||||
@@ -96,9 +96,8 @@ void wxGenericStaticBitmap::OnPaint(wxPaintEvent& WXUNUSED(event))
|
|||||||
gc(wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc));
|
gc(wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(dc));
|
||||||
gc->DrawBitmap(bitmap, x, y, w, h);
|
gc->DrawBitmap(bitmap, x, y, w, h);
|
||||||
#else
|
#else
|
||||||
wxImage img = bitmap.ConvertToImage();
|
wxBitmap::Rescale(bitmap, wxSize(wxRound(w), wxRound(h)));
|
||||||
img.Rescale(wxRound(w), wxRound(h), wxIMAGE_QUALITY_HIGH);
|
dc.DrawBitmap(bitmap, wxRound(x), wxRound(y), true);
|
||||||
dc.DrawBitmap(wxBitmap(img), wxRound(x), wxRound(y), true);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user