if (window_dc)
gc = wxGraphicsContext::Create( *window_dc );
+#ifdef __WXMSW__
+ wxEnhMetaFileDC *emf_dc = wxDynamicCast( &dc, wxEnhMetaFileDC );
+ if (emf_dc)
+ gc = wxGraphicsContext::Create( *emf_dc );
+#endif
+
if (gc)
{
// make a path that contains a circle and some lines, centered at 100,100
gc->StrokePath(path);
// draw some text
- wxString text("This text is drawn by wxGraphicsContext");
- gc->SetFont( m_testFont, *wxBLUE );
- gc->DrawText(text, 50.0, 50.0);
+ wxString text("Text by wxGraphicsContext");
+ gc->SetFont( m_testFont, *wxBLACK );
+ gc->DrawText(text, 25.0, 60.0);
// draw rectangle around the text
double w, h, d, el;
gc->GetTextExtent(text, &w, &h, &d, &el);
- gc->SetPen( *wxBLUE_PEN );
- gc->DrawRectangle(50.0, 50.0, w, h);
+ gc->SetPen( *wxBLACK_PEN );
+ gc->DrawRectangle(25.0, 60.0, w, h);
delete gc;
}