Click or drag to resize

GdiExtensionMethodsShortenPolylineByDistanceFromStartAndEnd Method

Shortens a polyline 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[]? ShortenPolylineByDistanceFromStartAndEnd(
	this PointF[] points,
	double distanceFromStart,
	double distanceFromEnd
)

Parameters

points  PointF
The points of the polyline.
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