BezierArcPoints procedure
Converts an Arc and ArcLength into a Pointer to an Array of TPoints for use with Polyline or Polygon.
Declaration
procedure BezierArcPoints(X: LongInt; Y: LongInt; Width: LongInt;
Height: LongInt; Angle1: Extended;
Angle2: Extended; Rotation: Extended;
var Points: PPoint; var Count: LongInt)Description
Use BezierArcPoints to convert an elliptical arc to a pointer to an
array of TPoints for use with Polyline or Polygon.
The arc is defined by a rectangle which bounds the full ellipse. The
rectangle has the specified Width and Height, its top/left corner is at the
point X, Y. The start of the arc is given by the
eccentric Angle1, and its length is given by eccentric
Angle2. Both angles are expressed in 1/16th of a degree.
A full circle, for example, equals to 5760 (16*360). A positive value in
Angle2 means counter-clockwise while a negative value means clockwise
direction. Zero degrees is at the 3 o'clock position.
The Rotation parameter accepts a rotation angle for a rotated
ellipse - for a non-rotated ellipse this value would be 0, or 360*16.
The result is an approximation based on one or more Beziers. If the angle length is greater than 90 degrees, the procedure calls PolyBezierArcPoints, otherwise it converts the angles into a Bezier by calling Arc2Bezier which then is converted to an array of points by calling Bezier2PolyLine.
If Points is not initialized or Count is less than 0, it is set to
Nil and the array starts at 0, otherwise it tries to append points to
the array starting at Count. Points should ALWAYS be free'd when done
by calling ReallocMem(Points, 0) or FreeMem.
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
