- //TODO clipping not right
-// dc->DrawPoint(centr2);
-// dc->DrawPoint(x,y);
-
- if ((clip_x == x) &&
- (clip_y == y) &&
- (clip_width == tmparea.width) &&
- (clip_height == tmparea.height))
- {
- dc->DrawBitmap( m_tmp, clip_x, clip_y, TRUE );
- }
- else
- {
- int start_x = clip_x - (int)x;
- int start_y = clip_y - (int)y;
-
- //dc->DrawBitmap( bmp, x, y, TRUE );
- wxMemoryDC dcm;
- dcm.SelectObject(bmp);
- dc->Blit(clip_x, clip_y,clip_width, clip_height,&dcm,start_x,start_y,wxCOPY,TRUE);
- dcm.SelectObject(wxNullBitmap);
- }
+ dc->SetClippingRegion( clip_x, clip_y, clip_width, clip_height );
+ dc->DrawBitmap( bmp, x, y, TRUE );
+ dc->DestroyClippingRegion();