void OnPaint( wxPaintEvent &event );
void OnEraseBackground( wxEraseEvent &event );
+
+ wxBitmap m_bitmap;
private:
DECLARE_EVENT_TABLE()
wxScrolledWindowStyle|wxNO_FULL_REPAINT_ON_RESIZE|wxSUNKEN_BORDER )
{
SetScrollbars( 10, 10, 40, 100, 0, 0 );
+
+ m_bitmap = wxBitmap( mondrian_xpm );
+
+ new wxStaticBitmap( this, -1, m_bitmap, wxPoint(80,20) );
}
void MyCanvas::OnPaint( wxPaintEvent &event )
wxPaintDC dc(this);
PrepareDC( dc );
+ dc.SetBrush( *wxBLACK_BRUSH );
+ dc.DrawRectangle( 0,0,200,50 );
+
+ dc.DrawBitmap( m_bitmap, 10, 20, TRUE );
+
#if 0
wxRegionIterator upd( GetUpdateRegion() );
while (upd)
wxSize client_size = GetClientSize();
wxLogDebug( "size %d %d client_size %d %d", size.x, size.y, client_size.x, client_size.y );
#endif
-
+
+ int i;
dc.SetPen( *wxWHITE_PEN );
- for (int i = 0; i < 20; i += 2)
+ for (i = 0; i < 20; i += 2)
dc.DrawLine( i,i, i+100,i );
dc.SetPen( *wxWHITE_PEN );
- for (int i = 200; i < 220; i += 2)
+ for (i = 200; i < 220; i += 2)
dc.DrawLine( i-200,i, i-100,i );
wxRegion region( 110, 110, 80, 80 );