CD2DSolidColorBrush 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 CD2DSolidColorBrush Class.

A wrapper for ID2D1SolidColorBrush.

class CD2DSolidColorBrush : public CD2DBrush;  

Public Constructors

NameDescription
CD2DSolidColorBrush::CD2DSolidColorBrushOverloaded. Constructs a CD2DSolidColorBrush object.
CD2DSolidColorBrush::~CD2DSolidColorBrushThe destructor. Called when a D2D solid brush object is being destroyed.

Public Methods

NameDescription
CD2DSolidColorBrush::AttachAttaches existing resource interface to the object
CD2DSolidColorBrush::CreateCreates a CD2DSolidColorBrush. (Overrides CD2DResource::Create.)
CD2DSolidColorBrush::DestroyDestroys a CD2DSolidColorBrush object. (Overrides CD2DBrush::Destroy.)
CD2DSolidColorBrush::DetachDetaches resource interface from the object
CD2DSolidColorBrush::GetReturns ID2D1SolidColorBrush interface
CD2DSolidColorBrush::GetColorRetrieves the color of the solid color brush
CD2DSolidColorBrush::SetColorSpecifies the color of this solid color brush

Public Operators

NameDescription
CD2DSolidColorBrush::operator ID2D1SolidColorBrush*Returns ID2D1SolidColorBrush interface

Protected Data Members

NameDescription
CD2DSolidColorBrush::m_colorSolidBrush solid color.
CD2DSolidColorBrush::m_pSolidColorBrushStores a pointer to an ID2D1SolidColorBrush object.

CObject

CD2DResource

CD2DBrush

CD2DSolidColorBrush

Header: afxrendertarget.h

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

virtual ~CD2DSolidColorBrush();

Attaches existing resource interface to the object

void Attach(ID2D1SolidColorBrush* pResource);

Parameters

pResource
Existing resource interface. Cannot be NULL

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.

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.

Destroys a CD2DSolidColorBrush object.

virtual void Destroy();

Detaches resource interface from the object

ID2D1SolidColorBrush* Detach();

Return Value

Pointer to detached resource interface.

Returns ID2D1SolidColorBrush interface

ID2D1SolidColorBrush* Get();

Return Value

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

Retrieves the color of the solid color brush

D2D1_COLOR_F GetColor() const;  

Return Value

The color of this solid color brush

Brush solid color.

D2D1_COLOR_F m_colorSolid;  

Stores a pointer to an ID2D1SolidColorBrush object.

ID2D1SolidColorBrush* m_pSolidColorBrush;  

Returns ID2D1SolidColorBrush interface

operator ID2D1SolidColorBrush*();

Return Value

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

Specifies the color of this solid color brush

void SetColor(D2D1_COLOR_F color);

Parameters

color
The color of this solid color brush

Classes

Show: