CD2DResource Class
An abstract class that provides an interface for creating and managing D2D resources such as brushes, layers, and texts.
Syntax
class CD2DResource : public CObject;
Members
Protected Constructors
Name | Description |
---|---|
CD2DResource::CD2DResource | Constructs a CD2DResource object. |
CD2DResource::~CD2DResource | The destructor. Called when a D2D resource object is being destroyed. |
Public Methods
Name | Description |
---|---|
CD2DResource::Create | Creates a CD2DResource. |
CD2DResource::Destroy | Destroys a CD2DResource object. |
CD2DResource::IsValid | Checks resource validity |
Protected Methods
Name | Description |
---|---|
CD2DResource::IsAutoDestroy | Check auto destroy flag. |
CD2DResource::ReCreate | Re-creates a CD2DResource. |
Protected Data Members
Name | Description |
---|---|
CD2DResource::m_bIsAutoDestroy | Resource will be destroyed by owner (CRenderTarget) |
CD2DResource::m_pParentTarget | Pointer to the parent CRenderTarget) |
Inheritance Hierarchy
CD2DResource
Requirements
Header: afxrendertarget.h
CD2DResource::~CD2DResource
The destructor. Called when a D2D resource object is being destroyed.
virtual ~CD2DResource();
CD2DResource::CD2DResource
Constructs a CD2DResource object.
CD2DResource(
CRenderTarget* pParentTarget,
BOOL bAutoDestroy);
Parameters
pParentTarget
A pointer to the render target.
bAutoDestroy
Indicates that the object will be destroyed by owner (pParentTarget).
CD2DResource::Create
Creates a CD2DResource.
virtual HRESULT Create(CRenderTarget* pRenderTarget) = 0;
Parameters
pRenderTarget
A pointer to the render target.
Return Value
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
CD2DResource::Destroy
Destroys a CD2DResource object.
virtual void Destroy() = 0;
CD2DResource::IsAutoDestroy
Check auto destroy flag.
BOOL IsAutoDestroy() const;
Return Value
TRUE if the object will be destroyed by its owner; otherwise FALSE.
CD2DResource::IsValid
Checks resource validity
virtual BOOL IsValid() const = 0;
Return Value
TRUE if resource is valid; otherwise FALSE.
CD2DResource::m_bIsAutoDestroy
Resource will be destroyed by owner (CRenderTarget)
BOOL m_bIsAutoDestroy;
CD2DResource::m_pParentTarget
Pointer to the parent CRenderTarget)
CRenderTarget* m_pParentTarget;
CD2DResource::ReCreate
Re-creates a CD2DResource.
virtual HRESULT ReCreate(CRenderTarget* pRenderTarget);
Parameters
pRenderTarget
A pointer to the render target.
Return Value
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.