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:
committed by
Václav Slavík
parent
e99abe513a
commit
e71be91ebe
@@ -553,6 +553,8 @@ public :
|
||||
|
||||
virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window ) wxOVERRIDE;
|
||||
|
||||
virtual wxGraphicsContext * CreateContextFromNativeHDC(WXHDC dc) wxOVERRIDE;
|
||||
|
||||
virtual wxGraphicsContext * CreateContext( wxWindow* window ) wxOVERRIDE;
|
||||
|
||||
#if wxUSE_IMAGE
|
||||
@@ -2409,6 +2411,12 @@ wxGraphicsContext * wxGDIPlusRenderer::CreateContextFromNativeWindow( void * win
|
||||
return new wxGDIPlusContext(this,(HWND) window);
|
||||
}
|
||||
|
||||
wxGraphicsContext * wxGDIPlusRenderer::CreateContextFromNativeHDC(WXHDC dc)
|
||||
{
|
||||
ENSURE_LOADED_OR_RETURN(NULL);
|
||||
return new wxGDIPlusContext(this, new Graphics((HDC)dc));
|
||||
}
|
||||
|
||||
wxGraphicsContext * wxGDIPlusRenderer::CreateContext( wxWindow* window )
|
||||
{
|
||||
ENSURE_LOADED_OR_RETURN(NULL);
|
||||
|
Reference in New Issue
Block a user