Allow using a memory dc (or a buffered dc) as the target of

a wx.GraphicsContext.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-02-26 23:28:04 +00:00
parent a927054171
commit ee059415c1

View File

@@ -2013,7 +2013,16 @@ wxGraphicsRenderer* wxGraphicsRenderer::GetDefaultRenderer()
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxWindowDC& dc) wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContext( const wxWindowDC& dc)
{ {
return new wxMacCoreGraphicsContext(this,(CGContextRef)dc.GetWindow()->MacGetCGContextRef() ); wxMemoryDC* mdc = wxDynamicCast(&dc, wxMemoryDC);
if ( mdc )
{
return new wxMacCoreGraphicsContext(this,
(CGContextRef)mdc->GetGraphicsContext()->GetNativeContext());
}
else
{
return new wxMacCoreGraphicsContext(this,(CGContextRef)dc.GetWindow()->MacGetCGContextRef() );
}
} }
wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContextFromNativeContext( void * context ) wxGraphicsContext * wxMacCoreGraphicsRenderer::CreateContextFromNativeContext( void * context )