GRADIENT_RECT structure (wingdi.h)

The GRADIENT_RECT structure specifies the index of two vertices in the pVertex array in the GradientFill function. These two vertices form the upper-left and lower-right boundaries of a rectangle.

Syntax

typedef struct _GRADIENT_RECT {
  ULONG UpperLeft;
  ULONG LowerRight;
} GRADIENT_RECT, *PGRADIENT_RECT, *LPGRADIENT_RECT;

Members

UpperLeft

The upper-left corner of a rectangle.

LowerRight

The lower-right corner of a rectangle.

Remarks

The GRADIENT_RECT structure specifies the values of the pVertex array that are used when the dwMode parameter of the GradientFill function is GRADIENT_FILL_RECT_H or GRADIENT_FILL_RECT_V. For related GradientFill structures, see GRADIENT_TRIANGLE and TRIVERTEX.

The following images shows examples of a rectangle with a gradient fill - one in horizontal mode, the other in vertical mode.

Illustration of a rectangle that shades from dark on the left side to light on the right side Illustration of a rectangle that shades from dark on the top to light on the bottom

Examples

For an example, see Drawing a Shaded Rectangle.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header wingdi.h (include Windows.h)

See also

Bitmap Structures

Bitmaps Overview

GRADIENT_TRIANGLE

GradientFill

TRIVERTEX