Help Center

GdipAddPathBezierIfunction

Adds a Bézier spline to the current figure of this path.

Graphicsfunctiondocumented

Syntax

FUNCTION GdipAddPathBezierI (BYVAL path AS GpPath PTR, BYVAL x1 AS INT_, BYVAL y1 AS INT_, BYVAL x2 AS INT_, BYVAL y2 AS INT_, BYVAL x4 AS INT_, BYVAL y3 AS INT_, BYVAL x4 AS INT_, BYVAL y4 AS INT_) AS GpStatus
Also documented as GdipAddPathBezier — one description covers them all.

Parameters

NameDescription
path[in] Pointer to the GraphicsPath object.
x1[in] The x-coordinate of the starting point of the Bézier spline.
y1[in] The y-coordinate of the starting point of the Bézier spline.
x2[in] The x-coordinate of the first control point of the Bézier spline.
y2[in] The y-coordinate of the first control point of the Bézier spline.
x3[in] The x-coordinate of the second control point of the Bézier spline.
y3[in] The y-coordinate of the second control point of the Bézier spline.
x4[in] The x-coordinate of the ending point of the Bézier spline.
y4[in] The y-coordinate of the ending point of the Bézier spline.

Description

Adds a Bézier spline to the current figure of this path.

Example

' ======================================================================================== ' This example draws a Bézier curve using GdipAddPathBezier. ' ======================================================================================== SUB Example_DrawBezier (BYVAL hdc AS HDC)

DIM hStatus AS LONG

' // Create a graphics object from the device context DIM graphics AS GpGraphics PTR hStatus = GdipCreateFromHDC(hdc, @graphics)

' // Get the DPI scaling ratios DIM dpiX AS SINGLE hStatus = GdipGetDpiX(graphics, @dpiX) DIM rxRatio AS SINGLE = dpiX / 96 DIM dpiY AS SINGLE hStatus = GdipGetDpiY(graphics, @dpiY) Dim ryRatio AS SINGLE = dpiY / 96 ' // Set the scale transform hStatus = GdipScaleWorldTransform(graphics, rxRatio, ryRatio, MatrixOrderPrepend)

' // Create GraphicsPath DIM path AS GpPath PTR hStatus = GdipCreatePath(FillModeAlternate, @path)

' // Add Bézier curve: start ? control1 ? control2 ? end hStatus = GdipAddPathBezier(path, 50, 150, 100, 50, 200, 250, 250, 150)

' // Create pen DIM pen AS GpPen PTR hStatus = GdipCreatePen1(ARGB_BLUE, 2, UnitWorld, @pen)

' // Draw path hStatus = GdipDrawPath(graphics, pen, path)

' // Cleanup IF pen THEN GdipDeleteBrush(pen) IF path THEN GdipDeletePath(path) IF graphics THEN GdipDeleteGraphics(graphics)

END SUB ' ========================================================================================

Reference

  • Defined in AfxNova/AfxGdiPlus.bi:2034
  • Documented in Graphics/GdiPlus Flat Api/GdiPlusGraphicsPath.md
  • Topic: GraphicsPath Functions