- void OnPaint(wxPaintEvent&)
- {
- wxPaintDC dc(this);
-
- wxBitmap bmp(100, 100, 1);
- {
- wxMemoryDC memdc(bmp);
- memdc.SetBackground(*wxWHITE);
- memdc.SetTextForeground(*wxBLACK);
- memdc.Clear();
- memdc.DrawText(_T("Hello wx!"), 10, 10);
- }
-
- wxBitmap bmp2 = bmp;
- {
- wxMemoryDC memdc(bmp2);
- memdc.SetBackground(*wxWHITE);
- memdc.SetTextForeground(*wxRED);
- memdc.Clear();
- memdc.DrawText(_T("Goodbye!"), 10, 10);
- }
-
- dc.DrawBitmap(bmp, 10, 10);
- dc.DrawBitmap(bmp2, 120, 10);
- }
-