CGpGraphicsPath.AddBeziermethod
Adds a Bézier spline to the current figure of this path.
Syntax
FUNCTION AddBezier (BYVAL x1 AS SINGLE, BYVAL y1 AS SINGLE, BYVAL x2 AS SINGLE, BYVAL y2 AS SINGLE, BYVAL x3 AS SINGLE, BYVAL y3 AS SINGLE, BYVAL x4 AS SINGLE, BYVAL y4 AS SINGLE) AS GpStatus
FUNCTION AddBezier (BYVAL x1 AS INT_, BYVAL y1 AS INT_, BYVAL x2 AS INT_, BYVAL y2 AS INT_, BYVAL x3 AS INT_, BYVAL y3 AS INT_, BYVAL x4 AS INT_, BYVAL y4 AS INT_) AS GpStatus
FUNCTION AddBezier (BYVAL pt1 AS GpPointF, BYVAL pt2 AS GpPointF) AS GpStatus
FUNCTION AddBezier (BYVAL pt1 AS GpPoint, BYVAL pt2 AS GpPoint) AS GpStatus
Parameters
| Name | Description | |
|---|---|---|
x | The x-coordinate of the starting point of the Bézier spline. | |
y | The y-coordinate of the starting point of the Bézier spline. | |
x2 | The x-coordinate of the first control point of the Bézier spline. | |
y2 | The y-coordinate of the first control point of the Bézier spline. | |
x3 | The x-coordinate of the second control point of the Bézier spline. | |
y3 | The y-coordinate of the second control point of the Bézier spline. | |
x4 | The x-coordinate of the ending point of the Bézier spline. | |
y4 | The y-coordinate of the ending point of the Bézier 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
Adds a Bézier spline to the current figure of this path.
Example
' ======================================================================================== ' The following example creates a GraphicsPath object path, adds a Bézier spline to path, ' closes the current figure (the only figure in this case), and then draws path. ' ======================================================================================== SUB Example_AddBezier (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 path AS CGpGraphicsPath path.AddBezier(50, 50, 60, 20, 70, 100, 80, 50) path.CloseFigure
' // Draw the path. DIM pen AS CGpPen = ARGB_RED graphics.DrawPath(@pen, @path)
END SUB ' ========================================================================================
Reference
- Include file
CGpPath.inc - Defined in AfxNova/CGpPath.inc:234
- Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
- Topic: CGpGraphics Class