Declare Function CreateEllipticRgnIndirect Lib "gdi32.dll" (lpRect As RECT) As Long
Platforms: Win 32s, Win 95/98, Win NT
CreateEllipticRgn creates an elliptically-shaped region. The ellipse which forms the region is specified by the bounding rectangle defined by the rectangle structure passed to the function. The bounding rectangle is the smallest possible rectangle which can fit around the ellipse. The function returns a handle to the newly created region if successful, or 0 if an error occured.
Example:
' Invert the pixels within an elliptical region within window Form1. The
' elliptical region has a bounding rectangle of (20,30)-(150,110)
Dim hrgn As Long ' handle to the elliptical region
Dim bounding As RECT ' bounding rectangle
Dim retval As Long ' return value
' Load the coordinates of the bounding rectangle into the structure.
retval = SetRect(bounding, 20, 30, 150, 110) ' bounding = (20,30)-(150,110)
' Create the elliptical region from this bounding rectangle.
hrgn = CreateEllipticRgnIndirect(bounding)
' Invert the pixels on Form1 within the region.
retval = InvertRgn(Form1.hDC, hrgn)
' Delete the region to free up resources.
retval = DeleteObject(hrgn)
See Also: CreateEllipticRgn
Category: Regions
Go back to the alphabetical Function listing.
Go back to the Reference section index.
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/c/createellipticrgnindirect.html