Share via


CPoint::Offset

voidOffset(intxOffset**,intyOffset);**

voidOffset(POINTpoint**);**

voidOffset(SIZEsize**);**

Parameters

xOffset

Specifies the amount to offset the x member of the CPoint.

yOffset

Specifies the amount to offset the y member of the CPoint.

point

Specifies the amount (POINT or CPoint) to offset the CPoint.

size

Specifies the amount (SIZE or CSize) to offset the CPoint.

Remarks

Adds values to the x and y members of the CPoint.

Example

CPoint   ptStart(100, 100);
ptStart.Offset(35, 35);

CPoint   ptResult(135, 135);
ASSERT(ptStart == ptResult);

// works with POINT, too

ptStart = CPoint(100, 100);
POINT pt;

pt.x = 35;
pt.y = 35;

ptStart.Offset(pt);

ASSERT(ptStart == ptResult);

// works with SIZE, too

ptStart = CPoint(100, 100);
SIZE size;

size.cx = 35;
size.cy = 35;

ptStart.Offset(size);

ASSERT(ptStart == ptResult);

CPoint OverviewClass MembersHierarchy Chart

See Also   CPoint::operator +=, CPoint::operator –=