Freigeben über


CSize::operator +

CSizeoperator +(SIZEsize**)const;**

CPoint operator +( POINT point ) const;

CRect operator +( const RECT* lpRect ) const;

Remarks

These operators add this CSize value to the value of parameter. See the following descriptions of the individual operators:

  • operator +( size )   This operation adds two CSize values.

  • operator +( point )   This operation offsets (moves) a (or CPoint) value by this CSize value. The cx and cy members of this CSize value are added to the x and y data members of the POINT value. It is analogous to the version of CPoint::operator + that takes a parameter.

  • operator +( lpRect )   This operation offsets (moves) a (or CRect) value by this CSize value. The cx and cy members of this CSize value are added to the left, top, right, and bottom data members of the RECT value. It is analogous to the version of CRect::operator + that takes a parameter.

Example

CSize sz1(100, 100);
CSize sz2( 50,  25);
CSize szOut;

szOut = sz1 + sz2;

CSize szResult(150, 125);
ASSERT(szOut == szResult);

// works with SIZE, too

sz1 = CSize(100, 100);
SIZE sz3;
sz3.cx = 50;
sz3.cy = 25;

szOut = sz1 + sz3;
ASSERT(szOut == szResult);

CSize OverviewClass MembersHierarchy Chart

See Also   CPoint::operator +, CRect::operator +