Partager via


CRgn::SetRectRgn

Creates a rectangular region.

void SetRectRgn(
   int x1,
   int y1,
   int x2,
   int y2 
);
void SetRectRgn(
   LPCRECT lpRect 
);

Parameters

  • x1
    Specifies the x-coordinate of the upper-left corner of the rectangular region.

  • y1
    Specifies the y-coordinate of the upper-left corner of the rectangular region.

  • x2
    Specifies the x-coordinate of the lower-right corner of the rectangular region.

  • y2
    Specifies the y-coordinate of the lower-right corner of the rectangular region.

  • lpRect
    Specifies the rectangular region. Can be either a pointer to a RECT structure or a CRect object.

Remarks

Unlike CreateRectRgn, however, it does not allocate any additional memory from the local Windows application heap. Instead, it uses the space allocated for the region stored in the CRgn object. This means that the CRgn object must already have been initialized with a valid Windows region before calling SetRectRgn. The points given by x1, y1, x2, and y2 specify the minimum size of the allocated space.

Use this function instead of the CreateRectRgn member function to avoid calls to the local memory manager.

Requirements

Header: afxwin.h

See Also

Reference

CRgn Class

Hierarchy Chart

CRgn::CreateRectRgn

SetRectRgn

Other Resources

CRgn Members