Share via


CRect::Width

Calcola la larghezza CRect sottraendo il valore di da sinistra a destra valore.

int Width( ) const throw( );

Valore restituito

La larghezza CRect.

Note

La larghezza può essere negativo.

[!NOTA]

Il rettangolo deve essere normalizzato o la funzione può non riuscire.È possibile chiamare NormalizeRect per normalizzare il rettangolo prima di chiamare la funzione.

Esempio

CRect rect(20, 30, 80, 70);

int nWid = rect.Width();

// nWid is now 60
ASSERT(nWid == 60);   

Requisiti

Header: atltypes.h

Vedere anche

Riferimenti

Classe di CRect

Grafico della gerarchia

CRect::Height

CRect::Size

CRect::CenterPoint

CRect::IsRectEmpty

CRect::IsRectNull

CRect::NormalizeRect