previous | start | next

## Painting

- The paint function obtains a device context, which is an object that represents the surface of the window.
- The device context class has drawing functions such as `DrawLine`, `DrawEllipse`, and `DrawText`.

  >     void EllipseWindow::OnPaint(wxPaintEvent& event)
  >     {
  >        wxPaintDC dc(this);
  >        dc.SetBrush(*wxTRANSPARENT_BRUSH);
  >        wxSize size = GetSize();
  >        int x = 0;
  >        int y = 0;
  >        int width = size.GetWidth();
  >        int height = size.GetHeight();
  >        dc.DrawEllipse(x, y, width, height);
  >     }

previous | start | next