1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| void ScrollView::OnDraw(wxDC* dc)
{
wxClientDC dc2(this);
float zoomFactor = (float)2.0 ;
GetViewStart( &_displayedScreen.x, &_displayedScreen.y );
GetClientSize( &_displayedScreen.width,
&_displayedScreen.height );
dc->DrawBitmap(*_bmp, - _displayedScreen.x, -
_displayedScreen.y, true) ;
dc2.SetUserScale(zoomFactor, zoomFactor);
dc2.Blit( -_displayedScreen.x,
-_displayedScreen.y,
zoomFactor*_displayedScreen.width+_displayedScreen.x,
zoomFactor*_displayedScreen.height+_displayedScreen.y,
dc,
0,
0);
} |
Partager