Condividi tramite


CPoint::operator +=

Il primo overload aggiunge una dimensione a CPoint.

void operator +=(
   SIZE size 
) throw( );
void operator +=(
   POINT point 
) throw( );

Parametri

Note

Il secondo overload aggiunge un punto a CPoint.

In entrambi i casi, l'aggiunta a tale scopo è necessario aggiungere i membri cxo x ) dell'operando destro al membro xCPoint e l'aggiunta di un membro cyo y ) dell'operando destro al membro yCPoint.

Ad esempio, aggiungendo CPoint(5, -7) a una variabile contenente le modifiche CPoint(30, 40) la variabile a CPoint(35, 33).

Esempio

CPoint   ptStart(100, 100);
CSize   szOffset(35, 35);

ptStart += szOffset;

CPoint   ptResult(135, 135);

ASSERT(ptResult == ptStart);

// also works on SIZE

ptStart = CPoint(100, 100);

SIZE   sz;
sz.cx = 35;
sz.cy = 35;

ptStart += sz;

ASSERT(ptResult == ptStart);   

Requisiti

Header: atltypes.h

Vedere anche

Riferimenti

Classe di CPoint

Grafico della gerarchia

CPoint::operator - =

CPoint::operator +

CPoint::Offset