wxMemoryDC dc; wxBitmap bitmap(100, 100); dc.SelectObject(bitmap); dc.SetPen(wxPen(wxColour(wxT("BLACK")), 2)); dc.SetBrush(wxBrush(wxColour(wxT("WHITE")), wxBRUSHSTYLE_SOLID)); dc.DrawRoundedRectangle(10, 10, 80, 80, 10); // x, y, width, height, radius
wxClientDC dc(this); dc.SetPen(wxPen(wxColour(wxT("BLUE")), 3)); dc.SetBrush(wxBrush(wxColour(wxT("RED")), wxBRUSHSTYLE_TRANSPARENT)); dc.DrawRoundedRectangle(50, 50, 100, 100, 20); // x, y, width, height, radiusIn this example, a rounded rectangle is created with a pen color of blue and width of 3 pixels, and a brush color of red and a transparent style using wxClientDC, which is a device context that represents the client area of a window. Package Library: wxWidgets (wxWidgets/dc.h)