LinearGradientBrush::GetInterpolationColors method (gdiplusbrush.h)
The LinearGradientBrush::GetInterpolationColors method gets the colors currently set to be interpolated for this linear gradient brush and their corresponding blend positions.
Syntax
Status GetInterpolationColors(
[out] Color *presetColors,
[out] REAL *blendPositions,
[in] INT count
);
Parameters
[out] presetColors
Type: Color*
Pointer to an array that receives the colors. A color of a given index in the presetColors array corresponds to the blend position of that same index in the blendPositions array.
[out] blendPositions
Type: REAL*
Pointer to an array that receives the blend positions. Each number in the array indicates a percentage of the distance between the starting boundary and the ending boundary and is in the range from 0.0 through 1.0, where 0.0 indicates the starting boundary of the gradient and 1.0 indicates the ending boundary. A blend position between 0.0 and 1.0 indicates a line, parallel to the boundary lines, that is a certain fraction of the distance from the starting boundary to the ending boundary. For example, a blend position of 0.7 indicates the line that is 70 percent of the distance from the starting boundary to the ending boundary. The color is constant on lines that are parallel to the boundary lines.
[in] count
Type: INT
Integer that specifies the number of elements in the presetColors array. This is the same as the number of elements in the blendPositions array. Before calling the LinearGradientBrush::GetInterpolationColors method of a LinearGradientBrush object, call the LinearGradientBrush::GetInterpolationColorCount method of that same LinearGradientBrush object to determine the current number of colors. The number of blend positions retrieved is the same as the number of colors retrieved.
Return value
Type: Status
If the method succeeds, it returns Ok, which is an element of the Status enumeration.
If the method fails, it returns one of the other elements of the Status enumeration.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows XP, Windows 2000 Professional [desktop apps only] |
Minimum supported server | Windows 2000 Server [desktop apps only] |
Target Platform | Windows |
Header | gdiplusbrush.h (include Gdiplus.h) |
Library | Gdiplus.lib |
DLL | Gdiplus.dll |
See also
Filling a Shape with a Color Gradient
LinearGradientBrush::GetInterpolationColorCount