CDC::Rectangle 

BOOL Rectangle( int x1, int y1, int x2, int y2 );

BOOL Rectangle( LPCRECT lpRect );

Return Value

Nonzero if the function is successful; otherwise 0.

Parameters

x1

Specifies the x-coordinate of the upper-left corner of the rectangle (in logical units).

y1

Specifies the y-coordinate of the upper-left corner of the rectangle (in logical units).

x2

Specifies the x-coordinate of the lower-right corner of the rectangle (in logical units).

y2

Specifies the y-coordinate of the lower-right corner of the rectangle (in logical units).

lpRect

Specifies the rectangle in logical units. You can pass either a CRect object or a pointer to a RECT structure for this parameter.

Remarks

Draws a rectangle using the current pen. The interior of the rectangle is filled using the current brush.

The rectangle extends up to, but does not include, the right and bottom coordinates. This means that the height of the rectangle is y2y1 and the width of the rectangle is x2x1. Both the width and the height of a rectangle must be greater than 2 units and less than 32,767 units.

CDC OverviewClass MembersHierarchy Chart

See Also   ::Rectangle, CDC::PolyLine, CDC::RoundRect, RECT, CRect