반응형
CPoint
CPoint Class Members
CPoint::CPoint
CPoint::CPoint
CPoint( );
CPoint( int initX, int initY );
CPoint( POINT initPt );
CPoint( SIZE initSize );
CPoint( DWORD dwPoint );
Parameters
initX
Specifies the value of the x member of CPoint.
initY
Specifies the value of the y member of CPoint.
initPt
POINT structure or CPoint that specifies the values used to initialize CPoint.
initSize
SIZE structure or CSize that specifies the values used to initialize CPoint.
dwPoint
Sets the x member to the low-order word of dwPoint and the y member to the high-order word of dwPoint.
Remarks
Constructs a CPoint object. If no arguments are given, x and y members are not initialized.
Example
CPoint ptUndefined;
CPoint ptTopLeft(0,0);
// works from a POINT, too
POINT ptHere;
ptHere.x = 35;
ptHere.y = 95;
CPoint ptMFCHere(ptHere);
// works from A SIZE
SIZE sHowBig;
sHowBig.cx = 300;
sHowBig.cy = 10;
CPoint ptMFCBig(sHowBig);
// or from a DWORD
DWORD dwSize;
dwSize = MAKELONG(35, 95);
CPoint ptFromDouble(dwSize);
ASSERT(ptFromDouble == ptMFCHere);
CPoint Class Members
CPoint Class Members
Construction
CPoint | Constructs a CPoint. |
Operations
Offset | Adds values to the x and y members of the CPoint. |
operator == | Checks for equality between two points. |
operator != | Checks for inequality between two points. |
Operators Returning CPoint Values
operator += | Offsets CPoint by adding a size or point. |
operator –= | Offsets CPoint by subtracting a size or point. |
operator + | Returns the sum of a CPoint and a size or point. |
operator – | Returns the difference of a CPoint and a size, or the negation of a point. |
Operators Returning CSize Values
operator – | Returns the size difference between two points. |
Operators Returning CRect Values
operator + | Returns a CRect offset by a size. |
operator – | Returns a CRect offset by a negative size. |
'Fundamental Notes > MFC' 카테고리의 다른 글
MFC : CRect 객체 생성과 다루기 (0) | 2009.09.15 |
---|---|
MFC : CPoint 객체 생성과 다루기 (0) | 2009.09.15 |
MFC : CString constructor overview (0) | 2009.09.15 |
MFC : CString 객체 생성과 초기화 (0) | 2009.09.15 |
MFC : MFC Console Resource 관리 + MakeLower() + MakeReverse() (0) | 2009.09.15 |