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:
@@ -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 )
|
||||||
|
Reference in New Issue
Block a user