| description | Learn more about: CD2DResource Class | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| title | CD2DResource Class | ||||||||||
| ms.date | 03/27/2019 | ||||||||||
| f1_keywords |
|
||||||||||
| helpviewer_keywords |
|
||||||||||
| ms.assetid | 34e3ee18-aab6-4c39-9294-de869e1f7820 |
An abstract class that provides an interface for creating and managing D2D resources such as brushes, layers, and texts.
class CD2DResource : public CObject;
| Name | Description |
|---|---|
| CD2DResource::CD2DResource | Constructs a CD2DResource object. |
| CD2DResource::~CD2DResource | The destructor. Called when a D2D resource object is being destroyed. |
| Name | Description |
|---|---|
| CD2DResource::Create | Creates a CD2DResource. |
| CD2DResource::Destroy | Destroys a CD2DResource object. |
| CD2DResource::IsValid | Checks resource validity |
| Name | Description |
|---|---|
| CD2DResource::IsAutoDestroy | Check auto destroy flag. |
| CD2DResource::ReCreate | Re-creates a CD2DResource. |
| Name | Description |
|---|---|
| CD2DResource::m_bIsAutoDestroy | Resource will be destroyed by owner (CRenderTarget) |
| CD2DResource::m_pParentTarget | Pointer to the parent CRenderTarget) |
CD2DResource
Header: afxrendertarget.h
The destructor. Called when a D2D resource object is being destroyed.
virtual ~CD2DResource();
Constructs a CD2DResource object.
CD2DResource(
CRenderTarget* pParentTarget,
BOOL bAutoDestroy);
pParentTarget
A pointer to the render target.
bAutoDestroy
Indicates that the object will be destroyed by owner (pParentTarget).
Creates a CD2DResource.
virtual HRESULT Create(CRenderTarget* pRenderTarget) = 0;
pRenderTarget
A pointer to the render target.
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Destroys a CD2DResource object.
virtual void Destroy() = 0;
Check auto destroy flag.
BOOL IsAutoDestroy() const;
TRUE if the object will be destroyed by its owner; otherwise FALSE.
Checks resource validity
virtual BOOL IsValid() const = 0;
TRUE if resource is valid; otherwise FALSE.
Resource will be destroyed by owner (CRenderTarget)
BOOL m_bIsAutoDestroy;
Pointer to the parent CRenderTarget)
CRenderTarget* m_pParentTarget;
Re-creates a CD2DResource.
virtual HRESULT ReCreate(CRenderTarget* pRenderTarget);
pRenderTarget
A pointer to the render target.
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.