|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Creates a rectangular region that is stored in the CRgn object.
BOOL CreateRectRgn( int x1, int y1, int x2, int y2 );
- Specifies the logical x-coordinate of the upper-left corner of the region.
- Specifies the logical y-coordinate of the upper-left corner of the region.
- Specifies the logical x-coordinate of the lower-right corner of the region.
- Specifies the logical y-coordinate of the lower-right corner of the region.
Nonzero if the operation succeeded; otherwise 0.
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.
CRgn rgn; BOOL bSucceeded = rgn.CreateRectRgn( 50, 20, 150, 120 ); ASSERT( bSucceeded == TRUE );
For an additional example, see CRgn::CombineRgn.