CPoint::CPoint
建構 CPoint 物件。
CPoint( ) throw( );
CPoint(
int initX,
int initY
) throw( );
CPoint(
POINT initPt
) throw( );
CPoint(
SIZE initSize
) throw( );
CPoint(
LPARAM dwPoint
) throw( );
參數
initX
指定 CPoint 之 x 成員的值。initY
指定 CPoint 之 y 成員的值。initPt
POINT 結構或 CPoint,它會指定用來初始化 CPoint 的值。dwPoint
將 x 成員設定為 dwPoint 的低階層文字,並將 y 成員設定為 dwPoint 的高階層文字。
備註
如果未提供引數,x 和 y 成員都會設定為 0。
範例
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);
需求
標頭:atltypes.h