CD2DSolidColorBrush Class

A wrapper for ID2D1SolidColorBrush.

Syntax

class CD2DSolidColorBrush : public CD2DBrush;

Members

Public Constructors

Name Description
CD2DSolidColorBrush::CD2DSolidColorBrush Overloaded. Constructs a CD2DSolidColorBrush object.
CD2DSolidColorBrush::~CD2DSolidColorBrush The destructor. Called when a D2D solid brush object is being destroyed.

Public Methods

Name Description
CD2DSolidColorBrush::Attach Attaches existing resource interface to the object
CD2DSolidColorBrush::Create Creates a CD2DSolidColorBrush. (Overrides CD2DResource::Create.)
CD2DSolidColorBrush::Destroy Destroys a CD2DSolidColorBrush object. (Overrides CD2DBrush::Destroy.)
CD2DSolidColorBrush::Detach Detaches resource interface from the object
CD2DSolidColorBrush::Get Returns ID2D1SolidColorBrush interface
CD2DSolidColorBrush::GetColor Retrieves the color of the solid color brush
CD2DSolidColorBrush::SetColor Specifies the color of this solid color brush

Public Operators

Name Description
CD2DSolidColorBrush::operator ID2D1SolidColorBrush* Returns ID2D1SolidColorBrush interface

Protected Data Members

Name Description
CD2DSolidColorBrush::m_colorSolid Brush solid color.
CD2DSolidColorBrush::m_pSolidColorBrush Stores a pointer to an ID2D1SolidColorBrush object.

Inheritance Hierarchy

CObject

CD2DResource

CD2DBrush

CD2DSolidColorBrush

Requirements

Header: afxrendertarget.h

CD2DSolidColorBrush::~CD2DSolidColorBrush

The destructor. Called when a D2D solid brush object is being destroyed.

virtual ~CD2DSolidColorBrush();

CD2DSolidColorBrush::Attach

Attaches existing resource interface to the object

void Attach(ID2D1SolidColorBrush* pResource);

Parameters

pResource
Existing resource interface. Cannot be NULL

CD2DSolidColorBrush::CD2DSolidColorBrush

Constructs a CD2DSolidColorBrush object.

CD2DSolidColorBrush(
    CRenderTarget* pParentTarget,
    D2D1_COLOR_F color,
    CD2DBrushProperties* pBrushProperties = NULL,
    BOOL bAutoDestroy = TRUE);

CD2DSolidColorBrush(
    CRenderTarget* pParentTarget,
    COLORREF color,
    int nAlpha = 255,
    CD2DBrushProperties* pBrushProperties = NULL,
    BOOL bAutoDestroy = TRUE);

Parameters

pParentTarget
A pointer to the render target.

color
The red, green, blue, and alpha values of the brush's color.

pBrushProperties
A pointer to the opacity and transformation of a brush.

bAutoDestroy
Indicates that the object will be destroyed by owner (pParentTarget).

nAlpha
The opacity of the brush's color.

CD2DSolidColorBrush::Create

Creates a CD2DSolidColorBrush.

virtual HRESULT Create(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.

CD2DSolidColorBrush::Destroy

Destroys a CD2DSolidColorBrush object.

virtual void Destroy();

CD2DSolidColorBrush::Detach

Detaches resource interface from the object

ID2D1SolidColorBrush* Detach();

Return Value

Pointer to detached resource interface.

CD2DSolidColorBrush::Get

Returns ID2D1SolidColorBrush interface

ID2D1SolidColorBrush* Get();

Return Value

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

CD2DSolidColorBrush::GetColor

Retrieves the color of the solid color brush

D2D1_COLOR_F GetColor() const;

Return Value

The color of this solid color brush

CD2DSolidColorBrush::m_colorSolid

Brush solid color.

D2D1_COLOR_F m_colorSolid;

CD2DSolidColorBrush::m_pSolidColorBrush

Stores a pointer to an ID2D1SolidColorBrush object.

ID2D1SolidColorBrush* m_pSolidColorBrush;

CD2DSolidColorBrush::operator ID2D1SolidColorBrush*

Returns ID2D1SolidColorBrush interface

operator ID2D1SolidColorBrush*();

Return Value

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

CD2DSolidColorBrush::SetColor

Specifies the color of this solid color brush

void SetColor(D2D1_COLOR_F color);

Parameters

color
The color of this solid color brush

See also

Classes