Add API to create wxGraphicsContext from win32 HDC

Add wxGraphicsContext::CreateFromNativeHDC() and wxGraphicsRenderer::
CreateContextFromNativeHDC() to allow creation not only from native
renderer object, but also from HDC, which is something universally
supported by win32 implementations.
This commit is contained in:
Václav Slavík
2017-01-05 17:05:11 +01:00
committed by Václav Slavík
parent e99abe513a
commit e71be91ebe
6 changed files with 59 additions and 0 deletions

View File

@@ -961,6 +961,13 @@ wxGraphicsContext* wxGraphicsContext::CreateFromNativeWindow( void * window )
return wxGraphicsRenderer::GetDefaultRenderer()->CreateContextFromNativeWindow(window);
}
#ifdef __WXMSW__
wxGraphicsContext* wxGraphicsContext::CreateFromNativeHDC(WXHDC dc)
{
return wxGraphicsRenderer::GetDefaultRenderer()->CreateContextFromNativeHDC(dc);
}
#endif
wxGraphicsContext* wxGraphicsContext::Create( wxWindow* window )
{
return wxGraphicsRenderer::GetDefaultRenderer()->CreateContext(window);