Help Center

CGpPathGradientBrush.GetInterpolationColorCountmethod

Gets the number of preset colors currently specified for this brush.

GraphicsmethodCGpBrush.incdocumented

Syntax

FUNCTION GetInterpolationColorCount () AS INT

Return value

This method returns the number of preset colors currently specified for this path gradient brush.

Description

Gets the number of preset colors currently specified for this path gradient brush.

Remarks

A simple path gradient brush has two colors: a boundary color and a center color. When you paint with such a brush, the color changes gradually from the boundary color to the center color as you move from the boundary path to the center point. You can create a more complex gradient by specifying an array of preset colors and an array of blend positions.

You can obtain the interpolation colors and interpolation positions currently set for a PathGradientBrush object by calling the GetInterpolationColors method of that PathGradientBrush object. Before you call the GetInterpolationColors method, you must allocate two buffers: one to hold the array of interpolation colors and one to hold the array of interpolation positions. You can call the GetInterpolationColorCount method of the PathGradientBrush object to determine the required size of those buffers. The size of the color buffer is the return value of GetInterpolationColorCount multiplied by 4. The size of the position buffer is the value of GetInterpolationColorCount multiplied by 4 (the size of a single precision number).

Reference

  • Include file CGpBrush.inc
  • Defined in AfxNova/CGpBrush.inc:769
  • Documented in Graphics/GdiPlus Classes/CGpBrush Classes.md
  • Topic: CGpBrush Class