![Smooth Smooth](http://img110.xooimage.com/files/9/6/3/drawing-lines-4df9205.png)
I'm working on windows application type in VS 2017. The necessity is definitely to draw a bezier curve by making use of three insight figures like (56, 150, 400).
Mar 29, 2017 - When you use GDI+ to draw a line, you provide the starting point. Antialiasing, also called smoothing, can also be applied to curves.
I'michael really puzzled as how to draw this.
Muhammad Umer Farooq
Muhammad Umer FarooqMuhammad Umer Farooq
2 Solutions
Sketching a spline through three points doesn't create the same outcome as sketching a cubic Bezier curve. A spline curve is inclined to have sharper bends (think of a cable coathanger).
In fact the.Net framework will include quadratic Beziers: the QuadraticBezierSegment in WPF. With suitable references, it wouldn't end up being tough to create a functionality to use it in a System.Drawing context.
But it's i9000 even easier to draw a quadratic Bezier curve making use of plain arithmetic. You start by selecting the quantity of factors to plot of land - 5 points might end up being more than enough, or more if you wish a smoother result. Right here's a functionality (plus 2 supporting features) which, given 3 control factors and the number of factors you want to piece, profits a listing of PointFs representing the quadratic Bezier:
Once you have the points, you can draw the curve nevertheless you including, for instance using Graphics.DrawCurve or as right lines. Even with simply 5 factors, it will look a great deal more like a Bezier than drawing through just 3 points.
LarsTech71.3k1313 silver badges117117 silver precious metal badges165165 bronze badges
user2738137user2738137
Afterthought. The simplest achievable response to the first question is definitely simply to repeat one of the accessible points. For instance g2 as here:
The outcome earned't be the exact same as a quadratic Bezier, because the doubled stage 'pulls' more difficult on the curve. But it will nevertheless become a Bezier curve.
BB
user2738137consumer2738137