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

@@ -482,6 +482,15 @@ public:
*/
static wxGraphicsContext* CreateFromNativeWindow(void* window);
/**
Creates a wxGraphicsContext from a native DC handle. Windows only.
@see wxGraphicsRenderer::CreateContextFromNativeHDC()
@since 3.1.1
*/
static wxGraphicsContext* CreateFromNativeHDC(WXHDC dc);
/**
Create a lightweight context that can be used only for measuring text.
*/
@@ -1321,6 +1330,13 @@ public:
*/
virtual wxGraphicsContext* CreateContextFromNativeWindow(void* window) = 0;
/**
Creates a wxGraphicsContext from a native DC handle. Windows only.
@since 3.1.1
*/
static wxGraphicsContext* CreateContextFromNativeHDC(WXHDC dc);
/**
Creates a wxGraphicsContext that can be used for measuring texts only.
No drawing commands are allowed.