Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ID2D1GdiInteropRenderTarget::GetDC method

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.

hdc [out]

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

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]

Header

D2d1.h

Library

D2d1.lib

DLL

D2d1.dll

See also

ID2D1GdiInteropRenderTarget

 

 

Show:
© 2017 Microsoft