2.1.27.21 OffsetRect


Description

This function moves the specified rectangle by the specified offsets.

Syntax

BOOL OffsetRect( RECT * lprc, int dx, int dy )

Parameters

lprc
[modify] Pointer to a RECT structure that contains the logical coordinates of the rectangle to be moved.
dx
[input] Specifies the amount to move the rectangle left or right. This parameter must be a negative value to move the rectangle to the left.
dy
[input] Specifies the amount to move the rectangle up or down. This parameter must be a negative value to move the rectangle up.

Return

Returns TRUE for success.

Examples

EX1

void OffsetRect_Ex1()
{
	RECT rect ;
	rect.left=20;
	rect.top=20;
	rect.right=60;
	rect.bottom=60;
	
	if(OffsetRect(&rect,10,-10))
	{
		printf("now the rect offset to :");
		printf("left:%d  top:%d  right:%d  bottom:%d\n",rect.left,rect.top,rect.right,rect.bottom);;
	}
}

Remark

See Also

InflateRect

Header to Include

origin.h

Reference