CGpGraphics.FillClosedCurvemethod
Creates a closed cardinal spline from an array of points and uses a brush to fill the interior of the spline.
Syntax
FUNCTION FillClosedCurve (BYVAL pBrush AS CGpBrush PTR, BYVAL pts AS GpPointF PTR, BYVAL count AS INT_) AS GpStatus
FUNCTION FillClosedCurve (BYVAL pBrush AS CGpBrush PTR, BYVAL pts AS GpPoint PTR, BYVAL count AS INT_) AS GpStatus
FUNCTION FillClosedCurve (BYVAL pBrush AS CGpBrush PTR, BYVAL pts AS GpPointF PTR, BYVAL count AS INT_, BYVAL nFillMode AS FillMode, BYVAL tension AS SINGLE = 0.5) AS GpStatus
FUNCTION FillClosedCurve (BYVAL pBrush AS CGpBrush PTR, BYVAL pts AS GpPoint PTR, BYVAL count AS INT_, BYVAL nFillMode AS FillMode, BYVAL tension AS SINGLE = 0.5) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
pBrush | Pointer to a Brush object that is used to paint the interior of the spline. | |
pts | Pointer to an array of points that this method uses to create a closed cardinal spline. Each point in the array is a point on the spline. | |
count | Integer that specifies the number of points in the points array. | |
fillMode | Element of the FillMode enumeration that specifies how to fill a closed area that is created when the curve passes over itself. | |
tension | Optional. Nonnegative real number that specifies how tightly the spline bends as it passes through the points. A value of 0 specifies that the spline is a sequence of straight lines. As the value increases, the curve becomes fuller. The default value is 0.5!. |
Return value
If the function succeeds, it returns StatusOk, which is an element of the GpStatus enumeration.
If the function fails, it returns one of the other elements of the GpStatus enumeration.
Description
Creates a closed cardinal spline from an array of points and uses a brush to fill the interior of the spline.
Example
' ======================================================================================== ' The following example draws a closed cardinal spline. ' ======================================================================================== SUB Example_FillClosedCurve (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi
' // Define a Brush object and an array of Point objects. DIM blackBrush AS CGpSolidBrush = ARGB_BLACK DIM point1 AS GpPoint = (100, 100) DIM point2 AS GpPoint = (200, 50) DIM point3 AS GpPoint = (250, 200) DIM point4 AS GpPoint = (50, 150) DIM pts(3) AS GpPoint = {point1, point2, point3, point4}
' //Fill the curve. graphics.FillClosedCurve(@blackBrush, @pts(0), 4)
END SUB ' ========================================================================================
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:818
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class