HRGN CreateEllipticRgnIndirect(lprc) | |||||
const RECT FAR* lprc; | /* address of structure with bounding rectangle | */ |
The CreateEllipticRgnIndirect function creates an elliptical region.
lprc
Points to a RECT structure that contains the logical coordinates of the upper-left and lower-right corners of the bounding rectangle of the ellipse. The RECT structure has the following form:
typedef struct tagRECT { /* rc */
int left;
int top;
int right;
int bottom;
} RECT;
For a full description of this structure, see the Microsoft Windows Programmer's Reference, Volume 3.
The return value is the handle of the region if the function is successful. Otherwise, it is NULL.
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 CreateEllipticRgnIndirect, an application should remove the region by using the DeleteObject function.
The following example assigns values to the members of a RECT structure, uses the CreateEllipticRgnIndirect function to create an elliptical region, selects the region into a device context, and then uses the PaintRgn function to display the region:
HDC hdc;
RECT rc;
HRGN hrgn;
SetRect(&rc, 10, 10, 200, 50);
hrgn = CreateEllipticRgnIndirect(&rc);
SelectObject(hdc, hrgn);
PaintRgn(hdc, hrgn);