+void MyCanvas::OnPaint (wxPaintEvent &)
+{
+ size_t numImages = m_images.GetCount();
+
+ wxPaintDC dc(this);
+ dc.BeginDrawing();
+
+ dc.SetTextForeground(wxColour(255, 255, 255));
+ dc.DrawText(wxT("Click on the canvas to draw a duck."), 10, 10);
+
+ for (size_t i = 0; i < numImages; i++) {
+ MyRenderedImage & image = m_images.Item(i);
+ dc.DrawBitmap(image.m_bmp, image.m_x, image.m_y, true);
+ }
+
+ dc.EndDrawing();
+}
+
+// ----------------------------------------------------------------------------
+// main frame
+// ----------------------------------------------------------------------------
+
+BEGIN_EVENT_TABLE(MyFrame, wxFrame)
+ EVT_MENU (ID_Quit, MyFrame::OnQuit)
+ EVT_MENU (ID_Angle, MyFrame::OnAngle)
+ EVT_MENU (ID_Clear, MyFrame::OnClear)
+END_EVENT_TABLE()
+
+MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
+ : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size)