function Arc(const rec: TRect; startAngle, endAngle: double): TPathD;
The path follows an elliptical curve defined by the 'rec' parameter, usually in a clockwise direction. A point offset from the origin at an angle of 0 degrees will always be at 3 o'clock. However, if the CLOCKWISE_ROTATION_WITH_NEGATIVE_ANGLES directive is enabled, winding around the origin will proceed in an anti-clockwise direction. (Note: angles passed to functions in this library are almost always expressed in radians, not degrees).
uses
Img32, Img32.Fmt.PNG, Img32.Vector, Img32.Draw;
...
var
pt: TPointD;
path: TPathD;
rec: TRectD;
img: TImage32;
begin
img := TImage32.create(256,256);
rec := RectD(10,30, 256-10, 256-30);
path := Ellipse(rec);
DrawLine(img1, path, 20, clNavy32, esPolygon);
// Draw an arc over the ellipse that rotates
// clockwise from 3 o'clock around to 12 o'clock
// nb: Angle270 is a constant that expresses
// 270 degrees in radians.
path := Arc(rec, Angle0, Angle270);
DrawLine(img1, path, 5, clYellow32, esRound);
// Draw a red dot at 12 o'clock
pt := GetPtOnEllipseFromAngle(rec, Angle270);
DrawPoint(img, pt, 7, clRed32);
img.SaveToFile('arc.png');
img.Free;
Copyright ©2010-2023 Angus Johnson - Image32 4.8 - Help file built on 16 Apr 2025