| title | CD2DBrush Class | Microsoft Docs | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ms.custom | |||||||||||||||
| ms.date | 11/04/2016 | ||||||||||||||
| ms.reviewer | |||||||||||||||
| ms.suite | |||||||||||||||
| ms.technology |
|
||||||||||||||
| ms.tgt_pltfrm | |||||||||||||||
| ms.topic | reference | ||||||||||||||
| f1_keywords |
|
||||||||||||||
| dev_langs |
|
||||||||||||||
| helpviewer_keywords |
|
||||||||||||||
| ms.assetid | 0d2c0857-2261-48a8-8ee0-a88cbf08499a | ||||||||||||||
| caps.latest.revision | 17 | ||||||||||||||
| author | mikeblome | ||||||||||||||
| ms.author | mblome | ||||||||||||||
| manager | ghogen | ||||||||||||||
| translation.priority.ht |
|
A wrapper for ID2D1Brush.
class CD2DBrush : public CD2DResource;
| Name | Description |
|---|---|
| CD2DBrush::CD2DBrush | Constructs a CD2DBrush object. |
| CD2DBrush::~CD2DBrush | The destructor. Called when a D2D brush object is being destroyed. |
| Name | Description |
|---|---|
| CD2DBrush::Attach | Attaches existing resource interface to the object |
| CD2DBrush::Destroy | Destroys a CD2DBrush object. (Overrides CD2DResource::Destroy.) |
| CD2DBrush::Detach | Detaches resource interface from the object |
| CD2DBrush::Get | Returns ID2D1Brush interface |
| CD2DBrush::GetOpacity | Gets the degree of opacity of this brush |
| CD2DBrush::GetTransform | Gets the current transform of the render target |
| CD2DBrush::IsValid | Checks resource validity (Overrides CD2DResource::IsValid.) |
| CD2DBrush::SetOpacity | Sets the degree of opacity of this brush |
| CD2DBrush::SetTransform | Applies the specified transform to the render target, replacing the existing transformation. All subsequent drawing operations occur in the transformed space |
| Name | Description |
|---|---|
| CD2DBrush::operator ID2D1Brush* | Returns ID2D1Brush interface |
| Name | Description |
|---|---|
| CD2DBrush::m_pBrush | Stores a pointer to an ID2D1Brush object. |
| CD2DBrush::m_pBrushProperties | Brush properties. |
CD2DBrush
Header: afxrendertarget.h
The destructor. Called when a D2D brush object is being destroyed.
virtual ~CD2DBrush();
Attaches existing resource interface to the object
void Attach(ID2D1Brush* pResource);
pResource
Existing resource interface. Cannot be NULL
Constructs a CD2DBrush object.
CD2DBrush(
CRenderTarget* pParentTarget,
CD2DBrushProperties* pBrushProperties = NULL,
BOOL bAutoDestroy = TRUE);
pParentTarget
A pointer to the render target.
pBrushProperties
A pointer to the opacity and transformation of a brush.
bAutoDestroy
Indicates that the object will be destroyed by owner (pParentTarget).
Destroys a CD2DBrush object.
virtual void Destroy();
Detaches resource interface from the object
ID2D1Brush* Detach();
Pointer to detached resource interface.
Returns ID2D1Brush interface
ID2D1Brush* Get();
Pointer to an ID2D1Brush interface or NULL if object is not initialized yet.
Gets the degree of opacity of this brush
FLOAT GetOpacity() const;
A value between zero and 1 that indicates the opacity of the brush. This value is a constant multiplier that linearly scales the alpha value of all pixels filled by the brush. The opacity values are clamped in the range 0 to 1 before they are multiplied together
Gets the current transform of the render target
void GetTransform(D2D1_MATRIX_3X2_F* transform) const;
transform
When this returns, contains the current transform of the render target. This parameter is passed uninitialized
Checks resource validity
virtual BOOL IsValid() const;
TRUE if resource is valid; otherwise FALSE.
Stores a pointer to an ID2D1Brush object.
ID2D1Brush* m_pBrush;
Brush properties.
CD2DBrushProperties* m_pBrushProperties;
Returns ID2D1Brush interface
operator ID2D1Brush*();
Pointer to an ID2D1Brush interface or NULL if object is not initialized yet.
Sets the degree of opacity of this brush
void SetOpacity(FLOAT opacity);
opacity
A value between zero and 1 that indicates the opacity of the brush. This value is a constant multiplier that linearly scales the alpha value of all pixels filled by the brush. The opacity values are clamped in the range 0 to 1 before they are multiplied together
Applies the specified transform to the render target, replacing the existing transformation. All subsequent drawing operations occur in the transformed space
void SetTransform(const D2D1_MATRIX_3X2_F* transform);
transform
The transform to apply to the render target