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.

class CD2DRadialGradientBrush : public CD2DGradientBrush;  

Public Constructors

NameDescription
CD2DRadialGradientBrush::CD2DRadialGradientBrushConstructs a CD2DLinearGradientBrush object.
CD2DRadialGradientBrush::~CD2DRadialGradientBrushThe destructor. Called when a D2D radial gradient brush object is being destroyed.

Public Methods

NameDescription
CD2DRadialGradientBrush::AttachAttaches existing resource interface to the object
CD2DRadialGradientBrush::CreateCreates a CD2DRadialGradientBrush. (Overrides CD2DResource::Create.)
CD2DRadialGradientBrush::DestroyDestroys a CD2DRadialGradientBrush object. (Overrides CD2DGradientBrush::Destroy.)
CD2DRadialGradientBrush::DetachDetaches resource interface from the object
CD2DRadialGradientBrush::GetReturns ID2D1RadialGradientBrush interface
CD2DRadialGradientBrush::GetCenterRetrieves the center of the gradient ellipse
CD2DRadialGradientBrush::GetGradientOriginOffsetRetrieves the offset of the gradient origin relative to the gradient ellipse's center
CD2DRadialGradientBrush::GetRadiusXRetrieves the x-radius of the gradient ellipse
CD2DRadialGradientBrush::GetRadiusYRetrieves the y-radius of the gradient ellipse
CD2DRadialGradientBrush::SetCenterSpecifies the center of the gradient ellipse in the brush's coordinate space
CD2DRadialGradientBrush::SetGradientOriginOffsetSpecifies the offset of the gradient origin relative to the gradient ellipse's center
CD2DRadialGradientBrush::SetRadiusXSpecifies the x-radius of the gradient ellipse, in the brush's coordinate space
CD2DRadialGradientBrush::SetRadiusYSpecifies the y-radius of the gradient ellipse, in the brush's coordinate space

Public Operators

NameDescription
CD2DRadialGradientBrush::operator ID2D1RadialGradientBrush*Returns ID2D1RadialGradientBrush interface

Protected Data Members

NameDescription
CD2DRadialGradientBrush::m_pRadialGradientBrushA pointer to an ID2D1RadialGradientBrush.
CD2DRadialGradientBrush::m_RadialGradientBrushPropertiesThe center, gradient origin offset, and x-radius and y-radius of the brush's gradient.

CObject

CD2DResource

CD2DBrush

CD2DGradientBrush

CD2DRadialGradientBrush

Header: afxrendertarget.h

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

virtual ~CD2DRadialGradientBrush();

Attaches existing resource interface to the object

void Attach(ID2D1RadialGradientBrush* pResource);

Parameters

pResource
Existing resource interface. Cannot be NULL

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).

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.

Destroys a CD2DRadialGradientBrush object.

virtual void Destroy();

Detaches resource interface from the object

ID2D1RadialGradientBrush* Detach();

Return Value

Pointer to detached resource interface.

Returns ID2D1RadialGradientBrush interface

ID2D1RadialGradientBrush* Get();

Return Value

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

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

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

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

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

A pointer to an ID2D1RadialGradientBrush.

ID2D1RadialGradientBrush* m_pRadialGradientBrush;  

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

D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES m_RadialGradientBrushProperties;  

Returns ID2D1RadialGradientBrush interface

operator ID2D1RadialGradientBrush*();

Return Value

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

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

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

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

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

Classes

Show: