Udostępnij za pośrednictwem


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

A wrapper for ID2D1RadialGradientBrush.

Syntax

class CD2DRadialGradientBrush : public CD2DGradientBrush;  

Members

Public Constructors

Name Description
CD2DRadialGradientBrush::CD2DRadialGradientBrush Constructs a CD2DLinearGradientBrush object.
CD2DRadialGradientBrush::~CD2DRadialGradientBrush The destructor. Called when a D2D radial gradient brush object is being destroyed.

Public Methods

Name Description
CD2DRadialGradientBrush::Attach Attaches existing resource interface to the object
CD2DRadialGradientBrush::Create Creates a CD2DRadialGradientBrush. (Overrides CD2DResource::Create.)
CD2DRadialGradientBrush::Destroy Destroys a CD2DRadialGradientBrush object. (Overrides CD2DGradientBrush::Destroy.)
CD2DRadialGradientBrush::Detach Detaches resource interface from the object
CD2DRadialGradientBrush::Get Returns ID2D1RadialGradientBrush interface
CD2DRadialGradientBrush::GetCenter Retrieves the center of the gradient ellipse
CD2DRadialGradientBrush::GetGradientOriginOffset Retrieves the offset of the gradient origin relative to the gradient ellipse's center
CD2DRadialGradientBrush::GetRadiusX Retrieves the x-radius of the gradient ellipse
CD2DRadialGradientBrush::GetRadiusY Retrieves the y-radius of the gradient ellipse
CD2DRadialGradientBrush::SetCenter Specifies the center of the gradient ellipse in the brush's coordinate space
CD2DRadialGradientBrush::SetGradientOriginOffset Specifies the offset of the gradient origin relative to the gradient ellipse's center
CD2DRadialGradientBrush::SetRadiusX Specifies the x-radius of the gradient ellipse, in the brush's coordinate space
CD2DRadialGradientBrush::SetRadiusY Specifies the y-radius of the gradient ellipse, in the brush's coordinate space

Public Operators

Name Description
CD2DRadialGradientBrush::operator ID2D1RadialGradientBrush* Returns ID2D1RadialGradientBrush interface

Protected Data Members

Name Description
CD2DRadialGradientBrush::m_pRadialGradientBrush A pointer to an ID2D1RadialGradientBrush.
CD2DRadialGradientBrush::m_RadialGradientBrushProperties The center, gradient origin offset, and x-radius and y-radius of the brush's gradient.

Inheritance Hierarchy

CObject

CD2DResource

CD2DBrush

CD2DGradientBrush

CD2DRadialGradientBrush

Requirements

Header: afxrendertarget.h

CD2DRadialGradientBrush::~CD2DRadialGradientBrush

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

virtual ~CD2DRadialGradientBrush();

CD2DRadialGradientBrush::Attach

Attaches existing resource interface to the object

void Attach(ID2D1RadialGradientBrush* pResource);

Parameters

pResource
Existing resource interface. Cannot be NULL

CD2DRadialGradientBrush::CD2DRadialGradientBrush

Constructs a CD2DLinearGradientBrush object.

CD2DRadialGradientBrush(
    CRenderTarget* pParentTarget,  
    const D2D1_GRADIENT_STOP* gradientStops,  
    UINT gradientStopsCount,  
    D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES RadialGradientBrushProperties,  
    D2D1_GAMMA colorInterpolationGamma = D2D1_GAMMA_2_2,  
    D2D1_EXTEND_MODE extendMode = D2D1_EXTEND_MODE_CLAMP,  
    CD2DBrushProperties* pBrushProperties = NULL,  
    BOOL bAutoDestroy = TRUE);

Parameters

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.

RadialGradientBrushProperties
The center, gradient origin offset, and x-radius and y-radius of the brush's 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).

CD2DRadialGradientBrush::Create

Creates a CD2DRadialGradientBrush.

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.

CD2DRadialGradientBrush::Destroy

Destroys a CD2DRadialGradientBrush object.

virtual void Destroy();

CD2DRadialGradientBrush::Detach

Detaches resource interface from the object

ID2D1RadialGradientBrush* Detach();

Return Value

Pointer to detached resource interface.

CD2DRadialGradientBrush::Get

Returns ID2D1RadialGradientBrush interface

ID2D1RadialGradientBrush* Get();

Return Value

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

CD2DRadialGradientBrush::GetCenter

Retrieves the center of the gradient ellipse

CD2DPointF GetCenter() const;  

Return Value

The center of the gradient ellipse. This value is expressed in the brush's coordinate space

CD2DRadialGradientBrush::GetGradientOriginOffset

Retrieves the offset of the gradient origin relative to the gradient ellipse's center

CD2DPointF GetGradientOriginOffset() const;  

Return Value

The offset of the gradient origin from the center of the gradient ellipse. This value is expressed in the brush's coordinate space

CD2DRadialGradientBrush::GetRadiusX

Retrieves the x-radius of the gradient ellipse

FLOAT GetRadiusX() const;  

Return Value

The x-radius of the gradient ellipse. This value is expressed in the brush's coordinate space

CD2DRadialGradientBrush::GetRadiusY

Retrieves the y-radius of the gradient ellipse

FLOAT GetRadiusY() const;  

Return Value

The y-radius of the gradient ellipse. This value is expressed in the brush's coordinate space

CD2DRadialGradientBrush::m_pRadialGradientBrush

A pointer to an ID2D1RadialGradientBrush.

ID2D1RadialGradientBrush* m_pRadialGradientBrush;  

CD2DRadialGradientBrush::m_RadialGradientBrushProperties

The center, gradient origin offset, and x-radius and y-radius of the brush's gradient.

D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES m_RadialGradientBrushProperties;  

CD2DRadialGradientBrush::operator ID2D1RadialGradientBrush*

Returns ID2D1RadialGradientBrush interface

operator ID2D1RadialGradientBrush*();

Return Value

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

CD2DRadialGradientBrush::SetCenter

Specifies the center of the gradient ellipse in the brush's coordinate space

void SetCenter(CD2DPointF point);

Parameters

point
The center of the gradient ellipse, in the brush's coordinate space

CD2DRadialGradientBrush::SetGradientOriginOffset

Specifies the offset of the gradient origin relative to the gradient ellipse's center

void SetGradientOriginOffset(CD2DPointF gradientOriginOffset);

Parameters

gradientOriginOffset
The offset of the gradient origin from the center of the gradient ellipse

CD2DRadialGradientBrush::SetRadiusX

Specifies the x-radius of the gradient ellipse, in the brush's coordinate space

void SetRadiusX(FLOAT radiusX);

Parameters

radiusX
The x-radius of the gradient ellipse. This value is in the brush's coordinate space

CD2DRadialGradientBrush::SetRadiusY

Specifies the y-radius of the gradient ellipse, in the brush's coordinate space

void SetRadiusY(FLOAT radiusY);

Parameters

radiusY
The y-radius of the gradient ellipse. This value is in the brush's coordinate space

See Also

Classes