- if (dc->GetHDC() && M_METAFILEDATA->m_metafile)
- PlayMetaFile((HDC) dc->GetHDC(), (HMETAFILE) M_METAFILEDATA->m_metafile);
+ {
+#if wxMAC_USE_CORE_GRAPHICS
+#ifndef __LP64__
+ QDPictRef cgPictRef = M_METAFILEDATA->m_qdPictRef;
+ CGContextRef cg = (CGContextRef) dc->GetGraphicsContext()->GetNativeContext();
+ CGRect bounds = QDPictGetBounds( cgPictRef );
+
+ CGContextSaveGState( cg );
+ CGContextTranslateCTM( cg, 0, bounds.size.width );
+ CGContextScaleCTM( cg, 1, -1 );
+ QDPictDrawToCGContext( cg, bounds, cgPictRef );
+ CGContextRestoreGState( cg );
+#endif
+#else
+ PicHandle pict = (PicHandle)GetHMETAFILE();
+ wxMacPortSetter helper( dc );
+ Rect picFrame;
+ DrawPicture( pict, wxMacGetPictureBounds( pict, &picFrame ) );
+#endif
+ }