previous | start | next

## Painting

- Drawing images in a windowing environment is not quite as straightforward as you might think.
  - What happens when a user re-sizes the window? ... minimizes the window? ... restores the window?
  - What happens when another frame pops up over the image and then vanishes?
- The program has no idea when these events will happen.
- When they do happen, the window manager knows the contents of the window have been corrupted and sends a paint event to the program.
- The program needs to draw the image not just once, but every time a paint even occurs.
- All drawing instructions must be placed into a function that is is the target of paint events.

  >     EVT_PAINT(EllipseWindow::OnPaint)

previous | start | next