GraphicsPath.AddBezier(const PointF, const PointF, const PointF, const PointF) method
Applies to: desktop apps only
The GraphicsPath::AddBezier method adds a Bézier spline to the current figure of this path.
Syntax
Status AddBezier(
[in, ref] const PointF &pt1,
[in, ref] const PointF &pt2,
[in, ref] const PointF &pt3,
[in, ref] const PointF &pt4
);
Parameters
pt1 [in, ref]
Type: const PointFReference to a point at which to start the Bézier spline.
pt2 [in, ref]
Type: const PointFReference to a point that is the first control point of the Bézier spline.
pt3 [in, ref]
Type: const PointFReference to a point that is the second control point of the Bézier spline.
pt4 [in, ref]
Type: const PointFReference to a point at which to end the Bézier spline.
Return value
Type:
Type: Status****
If the method succeeds, it returns Ok, which is an element of the Status enumeration.
If the method fails, it returns one of the other elements of the Status enumeration.
Examples
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.
VOID Example_AddBezier(HDC hdc)
{
Graphics graphics(hdc);
GraphicsPath path;
PointF pt1(50.0f, 50.0f);
PointF pt2(60.0f, 20.0f);
PointF pt3(70.0f, 100.0f);
PointF pt4(80.0f, 50.0f);
path.AddBezier(pt1, pt2, pt3, pt4);
path.CloseFigure();
// Draw the path.
Pen pen(Color(255, 255, 0, 0));
graphics.DrawPath(&pen, &path);
}
Requirements
Minimum supported client |
Windows XP, Windows 2000 Professional |
Minimum supported server |
Windows 2000 Server |
Product |
GDI+ 1.0 |
Header |
Gdipluspath.h (include Gdiplus.h) |
Library |
Gdiplus.lib |
DLL |
Gdiplus.dll |
See also
Constructing and Drawing Paths
Send comments about this topic to Microsoft
Build date: 3/6/2012