function Pie(const rec: TRect; StartAngle, EndAngle: double): TPathD;
The path follows an elliptical curve defined by the 'rec' parameter, starting at 'startAngle' (with 0 degrees at 3 o'clock) and progressing anti-clockwise to 'endAngle' (angles in Radians) before finishing at the elliptical center.
uses Img32, Img32.Fmt.PNG, Img32.Vector, Img32.Draw; ... var img: TImage32; path: TPathD; rec: TRect; begin img := TImage32.Create(256,256); rec := img.Bounds; Windows.InflateRect(rec, -3,-3); path := Pie(rec, angle15, -angle15); //start with a drop shadow DrawShadow(img, path, frNonZero, 6); //draw the polygon DrawPolygon(img, path, frNonZero, $FF00DD00); //and add a 3D button effect Draw3D(img, path, frNonZero, 10,6); //finish with a solid green outline DrawLine(img, path, 5, clGreen32, esPolygon); img.SaveToFile('pie.png'); img.Free; end;
Copyright ©2010-2023 Angus Johnson - Image32 4.8 - Help file built on 17 Jan 2025