Rectangle

Syntax

BOOL Rectangle(hDC,X1,Y1,X2,Y2)

This function draws a rectangle. The interior of the rectangle is filled by using the selected brush, and a border is drawn with the selected pen.

Parameter Type/Description  

hDC HDC Identifies the device context.  
X1 int Specifies the logical x-coordinate of the upper-left corner of the rectangle.  
Y1 int Specifies the logical y-coordinate of the upper-left corner of the rectangle.  
X2 int Specifies the logical x-coordinate of the lower-right corner of the rectangle.  
Y2 int Specifies the logical y-coordinate of the lower-right corner of the rectangle.  

Return Value

The return value specifies whether the rectangle is drawn. It is nonzero if the rectangle is drawn. Otherwise, it is zero.

Comments

The width of the rectangle specified by the X1, Y1, X2, and Y2 parameters must not exceed 32,767 units. This limit applies to the height of the rectangle as well.

The current position is neither used nor updated by this function.