wxBufferedDC

Nusret Taşçı nusi at sofha.de
Mon Oct 23 05:56:06 PDT 2006


I'm using current CVS HEAD version with wxMSW and I have problems with 
wxBufferedDC.

The code I use is trivial, it looks like this:
void DerivedFrom_wxPanel::OnEraseBackground(wxEraseEvent &event)
{
     // pWindow is not an instance of DerivedFrom_wxPanel
     wxWindow *pWindow = wxStaticCast(event.GetEventObject(), wxWindow);
     wxClientDC dcX(pWindow);
     wxBufferedDC dc(&dcX);
     dc.SetBackground(*wxWHITE);
     dc.Clear();

     const wxImage &img = GetAImage();
     dc.DrawBitmap(img, 0, 0);
}

If I don't use wxBufferedDC but wxClientDC then the image is drawn fine 
- but with flicker.

Neither the call to Clear() nor the one to DrawBitmap() seems to have an 
effect. It doesn't matter if I construct wxBufferedDC with wxNullBitmap 
+ wxBUFFER_VIRTUAL_AREA. I have yet not tried to use it with a static 
bitmap.

Please note: wxBufferedPaintDC still works.

Is wxBufferedDC work in progress, or is it finished and I'm doing 
something severly wrong?

Regards,
Nusi.




More information about the wx-dev mailing list