wxDC* dc = new wxClientDC(this); wxColour bgColour = wxColour(255, 255, 255); dc->SetBackground(bgColour); dc->Clear();
wxMemoryDC dc(bitmap); wxColour bgColour = wxColour(0, 0, 0); dc.SetBackground(bgColour); dc.Clear();This example creates a wxMemoryDC device context from a wxBitmap object and sets its background colour to black using SetBackground(). Then it clears the device context using Clear(). The wxDC class is part of the wxWidgets library, which is a collection of c++ libraries for creating cross-platform GUI applications.