CD2DLinearGradientBrush Class
A wrapper for ID2D1LinearGradientBrush.
class CD2DLinearGradientBrush : public CD2DGradientBrush;
Name | Description |
---|---|
CD2DLinearGradientBrush::CD2DLinearGradientBrush | Constructs a CD2DLinearGradientBrush object. |
CD2DLinearGradientBrush::~CD2DLinearGradientBrush | The destructor. Called when a D2D linear gradient brush object is being destroyed. |
Name | Description |
---|---|
CD2DLinearGradientBrush::Attach | Attaches existing resource interface to the object |
CD2DLinearGradientBrush::Create | Creates a CD2DLinearGradientBrush. (Overrides CD2DResource::Create.) |
CD2DLinearGradientBrush::Destroy | Destroys a CD2DLinearGradientBrush object. (Overrides CD2DGradientBrush::Destroy.) |
CD2DLinearGradientBrush::Detach | Detaches resource interface from the object |
CD2DLinearGradientBrush::Get | Returns ID2D1LinearGradientBrush interface |
CD2DLinearGradientBrush::GetEndPoint | Retrieves the ending coordinates of the linear gradient |
CD2DLinearGradientBrush::GetStartPoint | Retrieves the starting coordinates of the linear gradient |
CD2DLinearGradientBrush::SetEndPoint | Sets the ending coordinates of the linear gradient in the brush's coordinate space |
CD2DLinearGradientBrush::SetStartPoint | Sets the starting coordinates of the linear gradient in the brush's coordinate space |
Name | Description |
---|---|
CD2DLinearGradientBrush::operator ID2D1LinearGradientBrush* | Returns ID2D1LinearGradientBrush interface |
Name | Description |
---|---|
CD2DLinearGradientBrush::m_LinearGradientBrushProperties | The start and end points of the gradient. |
CD2DLinearGradientBrush::m_pLinearGradientBrush | A pointer to an ID2D1LinearGradientBrush. |
CD2DLinearGradientBrush
Header: afxrendertarget.h
The destructor. Called when a D2D linear gradient brush object is being destroyed.
virtual ~CD2DLinearGradientBrush();
Attaches existing resource interface to the object
void Attach(ID2D1LinearGradientBrush* pResource);
pResource
Existing resource interface. Cannot be NULL
Constructs a CD2DLinearGradientBrush object.
CD2DLinearGradientBrush(
CRenderTarget* pParentTarget,
const D2D1_GRADIENT_STOP* gradientStops,
UINT gradientStopsCount,
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES LinearGradientBrushProperties,
D2D1_GAMMA colorInterpolationGamma = D2D1_GAMMA_2_2,
D2D1_EXTEND_MODE extendMode = D2D1_EXTEND_MODE_CLAMP,
CD2DBrushProperties* pBrushProperties = NULL,
BOOL bAutoDestroy = TRUE);
pParentTarget
A pointer to the render target.
gradientStops
A pointer to an array of D2D1_GRADIENT_STOP structures.
gradientStopsCount
A value greater than or equal to 1 that specifies the number of gradient stops in the gradientStops array.
LinearGradientBrushProperties
The start and end points of the gradient.
colorInterpolationGamma
The space in which color interpolation between the gradient stops is performed.
extendMode
The behavior of the gradient outside the [0,1] normalized range.
pBrushProperties
A pointer to the opacity and transformation of a brush.
bAutoDestroy
Indicates that the object will be destroyed by owner (pParentTarget).
Creates a CD2DLinearGradientBrush.
virtual HRESULT Create(CRenderTarget* pRenderTarget);
pRenderTarget
A pointer to the render target.
If the method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Destroys a CD2DLinearGradientBrush object.
virtual void Destroy();
Detaches resource interface from the object
ID2D1LinearGradientBrush* Detach();
Pointer to detached resource interface.
Returns ID2D1LinearGradientBrush interface
ID2D1LinearGradientBrush* Get();
Pointer to an ID2D1LinearGradientBrush interface or NULL if object is not initialized yet.
Retrieves the ending coordinates of the linear gradient
CD2DPointF GetEndPoint() const;
The ending two-dimensional coordinates of the linear gradient, in the brush's coordinate space
Retrieves the starting coordinates of the linear gradient
CD2DPointF GetStartPoint() const;
The starting two-dimensional coordinates of the linear gradient, in the brush's coordinate space
The start and end points of the gradient.
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES m_LinearGradientBrushProperties;
A pointer to an ID2D1LinearGradientBrush.
ID2D1LinearGradientBrush* m_pLinearGradientBrush;
Returns ID2D1LinearGradientBrush interface
operator ID2D1LinearGradientBrush*();
Pointer to an ID2D1LinearGradientBrush interface or NULL if object is not initialized yet.
Sets the ending coordinates of the linear gradient in the brush's coordinate space
void SetEndPoint(CD2DPointF point);
point
The ending two-dimensional coordinates of the linear gradient, in the brush's coordinate space
Sets the starting coordinates of the linear gradient in the brush's coordinate space
void SetStartPoint(CD2DPointF point);
point
The starting two-dimensional coordinates of the linear gradient, in the brush's coordinate space