Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Rect.Equals method

Applies to: desktop apps only

The Rect::Equals method determines whether two rectangles are the same.

Syntax

BOOL Equals(
  [in]  const Rect& rect
) const;

Parameters

rect [in]

Type: const Rect&

Reference to a rectangle to compare to this rectangle.

Return value

Type:

Type: BOOL

If the rectangles are the same, this method returns TRUE; otherwise, it returns FALSE.

Remarks

Two rectangles are the same if their X, Y, Width, and Height data members are the same.

Examples

The following example creates two Rect objects, moves the second Rect object horizontally by a specified value, and then determines whether the two Rect objects are the same.


Rect rect1(50, 50, 200, 100);
Rect rect2(20, 50, 200, 100);

rect2.Offset(30, 0);

if(rect2.Equals(rect1))
{
   // The two rectangles are the same.
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplustypes.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Rect
RectF
Using a Pen to Draw Lines and Rectangles
Pens, Lines, and Rectangles

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

Show: