CHwndRenderTarget Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at CHwndRenderTarget Class.

A wrapper for ID2D1HwndRenderTarget.

class CHwndRenderTarget : public CRenderTarget;  

Public Constructors

NameDescription
CHwndRenderTarget::CHwndRenderTargetConstructs a CHwndRenderTarget object from HWND.

Public Methods

NameDescription
CHwndRenderTarget::AttachAttaches existing render target interface to the object
CHwndRenderTarget::CheckWindowStateIndicates whether the HWND associated with this render target is occluded.
CHwndRenderTarget::CreateCreates a render target associated with the window
CHwndRenderTarget::DetachDetaches render target interface from the object
CHwndRenderTarget::GetHwndReturns the HWND associated with this render target.
CHwndRenderTarget::GetHwndRenderTargetReturns ID2D1HwndRenderTarget interface.
CHwndRenderTarget::ReCreateRe-creates a render target associated with the window
CHwndRenderTarget::ResizeChanges the size of the render target to the specified pixel size

Public Operators

NameDescription
CHwndRenderTarget::operator ID2D1HwndRenderTarget*Returns ID2D1HwndRenderTarget interface.

Protected Data Members

NameDescription
CHwndRenderTarget::m_pHwndRenderTargetA pointer to an ID2D1HwndRenderTarget object.

CObject

CRenderTarget

CHwndRenderTarget

Header: afxrendertarget.h

Attaches existing render target interface to the object

void Attach(ID2D1HwndRenderTarget* pTarget);

Parameters

pTarget
Existing render target interface. Cannot be NULL

Indicates whether the HWND associated with this render target is occluded.

D2D1_WINDOW_STATE CheckWindowState() const;  

Return Value

A value that indicates whether the HWND associated with this render target is occluded.

Constructs a CHwndRenderTarget object from HWND.

CHwndRenderTarget(HWND hwnd = NULL);

Parameters

hwnd
The HWND associated with this render target

Creates a render target associated with the window

BOOL Create(HWND hWnd);

Parameters

hWnd
The HWND associated with this render target

Return Value

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

Detaches render target interface from the object

ID2D1HwndRenderTarget* Detach();

Return Value

Pointer to detached render target interface.

Returns the HWND associated with this render target.

HWND GetHwnd() const;  

Return Value

The HWND associated with this render target.

Returns ID2D1HwndRenderTarget interface.

ID2D1HwndRenderTarget* GetHwndRenderTarget();

Return Value

Pointer to an ID2D1HwndRenderTarget interface or NULL if object is not initialized yet.

A pointer to an ID2D1HwndRenderTarget object.

ID2D1HwndRenderTarget* m_pHwndRenderTarget;  

Returns ID2D1HwndRenderTarget interface.

operator ID2D1HwndRenderTarget*();

Return Value

Pointer to an ID2D1HwndRenderTarget interface or NULL if object is not initialized yet.

Re-creates a render target associated with the window

BOOL ReCreate(HWND hWnd);

Parameters

hWnd
The HWND associated with this render target

Return Value

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

Changes the size of the render target to the specified pixel size

BOOL Resize(const CD2DSizeU& size);

Parameters

size
The new size of the render target in device pixels

Return Value

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

Classes

Show: