xtd 0.2.0
Loading...
Searching...
No Matches

◆ draw_curve() [8/8]

void xtd::drawing::graphics::draw_curve ( const pen pen,
const std::vector< xtd::drawing::point_f > &  points,
size_t  offset,
size_t  number_of_segments,
float  tension 
)

Draws a cardinal spline through a specified array of xtd::drawing::point_f structures using a specified tension. The drawing begins offset from the beginning of the array.

Parameters
penxtd::drawing::pen that determines the color, width, and style of the curve.
pointsArray of xtd::drawing::point_f structures that define the spline.
offsetOffset from the first element in the array of the points parameter to the starting point in the curve.
number_of_segmentsNumber of segments after the starting point to include in the curve.
tensionValue greater than or equal to 0.0F that specifies the tension of the curve.
Remarks
This method draws a cardinal spline that passes through each point in the array.
The array of points must contain at least three xtd::drawing::point_f structures for curve to be drawn.
The value of the offset parameter specifies the number of elements to skip in the array. The first element after the skipped elements represents the starting point of the curve.
The value of the number_of_segments parameter specifies the number of segments, after the starting point, to draw in the curve. The value of the number_of_segments parameter must be at least 1. The value of the offset parameter plus the value of the number_of_segments parameter must be less than the number of elements in the array of the points parameter.
The tension parameter determines the shape of the spline. If the value of the tension parameter is 0.0F, this method draws straight line segments to connect the points. Usually, the tension parameter is less than or equal to 1.0F. Values over 1.0F produce unusual results.