CDCRenderTarget class

A wrapper for ID2D1DCRenderTarget.

Syntax

class CDCRenderTarget : public CRenderTarget;

Members

Public Constructors

Name Description
CDCRenderTarget::CDCRenderTarget Constructs a CDCRenderTarget object.

Public Methods

Name Description
CDCRenderTarget::Attach Attaches existing render target interface to the object
CDCRenderTarget::BindDC Binds the render target to the device context to which it issues drawing commands
CDCRenderTarget::Create Creates a CDCRenderTarget.
CDCRenderTarget::Detach Detaches render target interface from the object
CDCRenderTarget::GetDCRenderTarget Returns an ID2D1DCRenderTarget interface

Public Operators

Name Description
CDCRenderTarget::operator ID2D1DCRenderTarget* Returns an ID2D1DCRenderTarget interface

Protected Data Members

Name Description
CDCRenderTarget::m_pDCRenderTarget A pointer to an ID2D1DCRenderTarget object.

Inheritance Hierarchy

CObject
CRenderTarget
CDCRenderTarget

Requirements

Header: afxrendertarget.h

CDCRenderTarget::Attach

Attaches existing render target interface to the object

void Attach(ID2D1DCRenderTarget* pTarget);

Parameters

pTarget
Existing render target interface. Can't be NULL

CDCRenderTarget::BindDC

Binds the render target to the device context to which it issues drawing commands

BOOL BindDC(
    const CDC& dc,
    const CRect& rect);

Parameters

dc
The device context to which the render target issues drawing commands

rect
The dimensions of the handle to a device context (HDC) to which the render target is bound

Return Value

If the method succeeds, it returns TRUE. Otherwise, it returns FALSE.

CDCRenderTarget::CDCRenderTarget

Constructs a CDCRenderTarget object.

CDCRenderTarget();

CDCRenderTarget::Create

Creates a CDCRenderTarget.

BOOL Create(const D2D1_RENDER_TARGET_PROPERTIES& props);

Parameters

props
The rendering mode, pixel format, remoting options, DPI information, and the minimum DirectX support required for hardware rendering.

Return Value

If the method succeeds, it returns TRUE. Otherwise, it returns FALSE.

CDCRenderTarget::Detach

Detaches render target interface from the object

ID2D1DCRenderTarget* Detach();

Return Value

Pointer to detached render target interface.

CDCRenderTarget::GetDCRenderTarget

Returns an ID2D1DCRenderTarget

ID2D1DCRenderTarget* GetDCRenderTarget();

Return Value

Pointer to an ID2D1DCRenderTarget interface or NULL if object isn't initialized yet.

CDCRenderTarget::m_pDCRenderTarget

A pointer to an ID2D1DCRenderTarget object.

ID2D1DCRenderTarget* m_pDCRenderTarget;

CDCRenderTarget::operator ID2D1DCRenderTarget*

Returns an ID2D1DCRenderTarget interface

operator ID2D1DCRenderTarget*();

Return Value

Pointer to an [ID2D1DCRenderTarget`](/windows/win32/api/d2d1/nn-d2d1-id2d1dcrendertarget) interface or NULL if object isn't initialized yet.

See also

Classes