wxDC* dc = new wxClientDC(panel); dc->SetBackgroundMode(wxBRUSHSTYLE_SOLID); // sets background mode to solid dc->DrawRectangle(10, 10, 100, 100); // fills rectangle with brush color
wxBitmap bmp; wxMemoryDC dc; dc.SelectObject(bmp); dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); // sets background mode to transparent dc.DrawRectangle(10, 10, 100, 100); // draws rectangle with no fillIn this example, a wxBitmap and wxMemoryDC are created, and the memory device context is set to the bitmap. The background mode is set to wxBRUSHSTYLE_TRANSPARENT, and a rectangle is drawn with no fill. Package library: wxWidgets