Share via


CRgn::CreateRectRgn

BOOLCreateRectRgn(intx1**,inty1,intx2,inty2);**

Return Value

Nonzero if the operation succeeded; otherwise 0.

Parameters

x1

Specifies the logical x-coordinate of the upper-left corner of the region.

y1

Specifies the logical y-coordinate of the upper-left corner of the region.

x2

Specifies the logical x-coordinate of the lower-right corner of the region.

y2

Specifies the logical y-coordinate of the lower-right corner of the region.

Remarks

Creates a rectangular region that is stored in the CRgn object.

The size of a region is limited to 32,767 by 32,767 logical units or 64K of memory, whichever is smaller.

When it has finished using a region created by CreateRectRgn, an application should use the CGDIObject::DeleteObject member function to remove the region.

Example

CRgn   rgn;

BOOL bSucceeded = rgn.CreateRectRgn( 50, 20, 150, 120 );
ASSERT( bSucceeded == TRUE );

For an additional example, see CRgn::CombineRgn.

CRgn OverviewClass MembersHierarchy Chart

See Also   CRgn::CreateRectRgnIndirect, CRgn::CreateRoundRectRgn,