CGpGraphics.DrawCurvemethod
Draws a cardinal spline.
Syntax
FUNCTION DrawCurve (BYVAL pPen AS CGpPen PTR, BYVAL pts AS GpPointF PTR, BYVAL count AS INT_) AS GpStatus
FUNCTION DrawCurve (BYVAL pPen AS CGpPen PTR, BYVAL pts AS GpPoint PTR, BYVAL count AS INT_) AS GpStatus
FUNCTION DrawCurve (BYVAL pPen AS CGpPen PTR, BYVAL pts AS GpPointF PTR, BYVAL count AS INT_, BYVAL tension AS SINGLE) AS GpStatus
FUNCTION DrawCurve (BYVAL pPen AS CGpPen PTR, BYVAL pts AS GpPoint PTR, BYVAL count AS INT_, BYVAL tension AS SINGLE) AS GpStatus
FUNCTION DrawCurve (BYVAL pPen AS CGpPen PTR, BYVAL pts AS GpPointF PTR, BYVAL count AS INT_, BYVAL tension AS SINGLE) AS GpStatus
FUNCTION DrawCurve (BYVAL pPen AS CGpPen PTR, BYVAL pts AS GpPointF PTR, BYVAL count AS INT_, BYVAL offset AS INT_, BYVAL numberOfSegments AS INT_, BYVAL tension AS SINGLE) AS GpStatus
FUNCTION DrawCurve (BYVAL pPen AS CGpPen PTR, BYVAL pts AS GpPoint PTR, BYVAL count AS INT_, BYVAL offset AS INT_, BYVAL numberOfSegments AS INT_, BYVAL tension AS SINGLE) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
pPen | Pointer to a pen that is used to draw the cardinal spline. | |
pts | Pointer to an array of GpPointF objects that specify the coordinates that the cardinal spline passes through. | |
count | Integer that specifies the number of elements in the points array. | |
offset | Integer that specifies the element in the points array that specifies the point at which the cardinal spline begins. | |
numberOfSegments | Integer that specifies the number of segments in the cardinal spline. | |
tension | Single precision number that specifies how tightly the curve bends through the coordinates of the cardinal spline. |
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
Draws a cardinal spline.
Remarks
A segment is defined as a curve that connects two consecutive points in the cardinal spline. The ending point of each segment is the starting point for the next.
Example
' ======================================================================================== ' The following example draws a cardinal spline. ' ======================================================================================== SUB Example_DrawCurve (BYVAL hdc AS HDC)
' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi
DIM greenPen AS CGpPen = CGpPen(ARGB_LIGHTGREEN, 3)
DIM point1 AS GpPointF = (100.0, 100.0) DIM point2 AS GpPointF = (200.0, 50.0) DIM point3 AS GpPointF = (400.0, 10.0) DIM point4 AS GpPointF = (500.0, 100.0)
DIM curvePoints(3) AS GpPointF curvePoints(0) = point1 curvePoints(1) = point2 curvePoints(2) = point3 curvePoints(3) = point4
' // Draw the curve. graphics.DrawCurve(@greenPen, @curvePoints(0), 4)
' // Draw the points in the curve. DIM redBrush AS CGpSolidBrush = ARGB_RED graphics.FillEllipse(@redBrush, 95, 95, 10, 10) graphics.FillEllipse(@redBrush, 195, 45, 10, 10) graphics.FillEllipse(@redBrush, 395, 5, 10, 10) graphics.FillEllipse(@redBrush, 495, 95, 10, 10)
END SUB ' ========================================================================================
Reference
- Include file
CGpGraphics.inc - Defined in AfxNova/CGpGraphics.inc:638
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class