XMConvertFloatToHalfStream
XMConvertHalfToFloatStream
XMMatrixDecompose
XMPlaneTransformStream
XMVector2TransformCoordStream
XMVector2TransformNormalStream
XMVector2TransformStream
XMVector3ProjectStream
XMVector3TransformCoordStream
XMVector3TransformNormalStream
XMVector3TransformStream
XMVector3UnprojectStream
XMVector4TransformStream
Expand Minimize

ID2D1LinearGradientBrush interface

Paints an area with a linear gradient.

When to implement

Custom implementations are not supported.

Members

The ID2D1LinearGradientBrush interface inherits from ID2D1Brush. ID2D1LinearGradientBrush also has these types of members:

Methods

The ID2D1LinearGradientBrush interface has these methods.

MethodDescription
GetEndPoint

Retrieves the ending coordinates of the linear gradient.

GetGradientStopCollection

Retrieves the ID2D1GradientStopCollection associated with this linear gradient brush.

GetStartPoint

Retrieves the starting coordinates of the linear gradient.

SetEndPoint

Sets the ending coordinates of the linear gradient in the brush's coordinate space.

SetStartPoint

Sets the starting coordinates of the linear gradient in the brush's coordinate space.

 

Remarks

An ID2D1LinearGradientBrush paints an area with a linear gradient along a line between the brush start point and end point. The gradient, defined by the brush ID2D1GradientStopCollection, is extruded perpendicular to this line, and then transformed by a brush transform (if specified).

The start point and end point are described in the brush space and are mappped to the render target when the brush is used. Note the starting and ending coordinates are absolute, not relative to the render target size. A value of (0, 0) maps to the upper-left corner of the render target, while a value of (1, 1) maps one pixel diagonally away from (0, 0). If there is a nonidentity brush transform or render target transform, the brush start point and end point are also transformed.

It is possible to specify a gradient axis that does not completely fill the area that is being painted. When this occurs, the D2D1_EXTEND_MODE, specified by the ID2D1GradientStopCollection, determines how the remaining area is painted.

Creating ID2D1LinearGradientBrush Objects

To create a linear gradient brush, use the ID2D1RenderTarget::CreateLinearGradientBrush method of the render target on which the brush will be used. The brush can only be used with the render target that created it or with the compatible targets for that render target.

A linear gradient brush is a device-dependent resource: your application should create linear gradient brushes after it initializes the render target with which the brushes will be used, and recreate the brushes whenever the render target needs recreated. (For more information about resources, see Resources Overview.)

Examples

For an example on how to use a linear gradient brush, see the Brush Types Example.

Requirements

Minimum supported client

Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1.h

Library

D2d1.lib

DLL

D2d1.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft