CSize::operator -

I primi tre di questi operatori astraggono questo valore CSize al valore del parametro.

CSize operator -( 
   SIZE size  
) const throw( );
CPoint operator -( 
   POINT point  
) const throw( );
CRect operator -( 
   const RECT* lpRect  
) const throw( );
CSize operator -( ) const throw( );

Note

Il quarto operatore, tramite l'operatore meno unario, cambia il segno del valore CSize.Vedere le descrizioni dei singoli operatori:

  • operator -( size ) questa operazione viene sottratto due valori CSize.

  • operator -( point ) questa operazione compensa (sposta) un valore CPoint o QUESTION da inverso dell'aggiunta del valore CSize.cx e cy di questo valore CSize vengono sottratti dai membri dati y e x del valore POINT.È analoga alla versione CPoint::operator - che accetta un parametro DIMENSIONE.

  • operator -( lpRect ) questa operazione compensa (sposta) un valore CRect o RECT da inverso dell'aggiunta del valore CSize.I membri cy e cx di questo valore CSize vengono sottratti da left, da top, da righte i membri dati bottom del valore RECT.È analoga alla versione CRect::operator - che accetta un parametro DIMENSIONE.

  • operator -( ) questa operazione restituisce l'opposto dell'aggiunta del valore CSize.

Esempio

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

szOut = sz1 - sz2;

CSize szResult(50, 75);
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);   

Requisiti

Header: atltypes.h

Vedere anche

Riferimenti

Classe di CSize

Grafico della gerarchia

CPoint::operator -

CRect::operator -