IDWriteBitmapRenderTarget::GetMemoryDC method (dwrite.h)

Gets a handle to the memory device context.

Syntax

HDC GetMemoryDC();

Return value

Type: HDC

Returns a device context handle to the memory device context.

Remarks

An application can use the device context to draw using GDI functions. An application can obtain the bitmap handle (HBITMAP) by calling GetCurrentObject. An application that wants information about the underlying bitmap, including a pointer to the pixel data, can call GetObject to fill in a DIBSECTION structure. The bitmap is always a 32-bit top-down DIB.

Note that this method takes no parameters and returns an HDC variable, not an HRESULT.

memoryHdc = g_pBitmapRenderTarget->GetMemoryDC();

The HDC returned here is still owned by the bitmap render target object and should not be released or deleted by the client.

Requirements

Requirement Value
Target Platform Windows
Header dwrite.h
Library Dwrite.lib
DLL Dwrite.dll

See also

IDWriteBitmapRenderTarget