LinearGradientBrush.GetRectangle(RectF*) method

Applies to: desktop apps only

The LinearGradientBrush::GetRectangle method gets the rectangle that defines the boundaries of the gradient.

Syntax

Status GetRectangle(
  [out]  RectF* rect
) const;

Parameters

  • rect [out]
    Type: RectF*

    Pointer to a RectF object that receives the rectangle that defines the boundaries of the gradient. For example, if a linear gradient brush is constructed with a starting point at (20.2, 50.8) and an ending point at (60.5, 110.0), then the defining rectangle has its upper-left point at (20.2, 50.8), a width of 40.3, and a height of 59.2.

Return value

Type:

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.

Remarks

The rectangle defines the boundaries of the gradient in the following ways: the right and left sides of the rectangle form the boundaries of a horizontal gradient; the top and bottom sides form the boundaries of a vertical gradient; two of the diagonally opposing corners lie on the boundaries of a diagonal gradient. In each of these cases, either side/corner may be on the starting boundary, depending on how the starting and ending points are passed to the constructor.

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusbrush.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

LinearGradientBrush

Pen

RectF

Creating a Linear Gradient

Using a Pen to Draw Lines and Rectangles

Brushes and Filled Shapes

Pens, Lines, and Rectangles

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012