Click or drag to resize

GdiExtensionMethodsShortenPartialPolylineByDistanceFromStartAndEnd Method

Shortens a partial polyline, given by the first point at index startIndex and the last index endIndex, at both sides in such a way that the new start has a distance distanceFromStart to the original start of the polyline, and the new end has a distance distanceFromEnd to the original end of the polyline. If the shortening leads to a polyline of zero length, then null is returned.

Namespace: Altaxo.Graph.Gdi
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static PointF[]? ShortenPartialPolylineByDistanceFromStartAndEnd(
	this PointF[] points,
	int startIndex,
	int endIndex,
	double distanceFromStart,
	double distanceFromEnd
)

Parameters

points  PointF
The points of the original global polyline.
startIndex  Int32
Index of first valid point of the partial polyline that is to be shortened.
endIndex  Int32
Index of the last valid point of the partial polyline that is to be shortened.
distanceFromStart  Double
The distance of the start of the shortened polyline to the first point of the original polyline (at index 0).
distanceFromEnd  Double
The distance of the end of the shortened polyline to the last point of the original polyline (at index points.Length-1).

Return Value

PointF
The shortened polyline, or null if the polyline was shortened to zero length.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type PointF. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also