ID2D1GdiInteropRenderTarget::GetDC method (d2d1.h)

Retrieves the device context associated with this render target.

Syntax

HRESULT GetDC(
        D2D1_DC_INITIALIZE_MODE mode,
  [out] HDC                     *hdc
);

Parameters

mode

Type: D2D1_DC_INITIALIZE_MODE

A value that specifies whether the device context should be cleared.

[out] hdc

Type: HDC*

When this method returns, contains the device context associated with this render target. You must allocate storage for this parameter.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Calling this method flushes the render target.

This command can be called only after BeginDraw and before EndDraw.

Note  In Windows 7 and earlier, you should not call GetDC between PushAxisAlignedClip/PopAxisAlignedClip commands or between PushLayer/PopLayer. However, this restriction does not apply to Windows 8 and later.
 

ReleaseDC must be called once for each call to GetDC.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps only]
Target Platform Windows
Header d2d1.h
Library D2d1.lib
DLL D2d1.dll

See also

ID2D1GdiInteropRenderTarget