Using Canvas. lazarus / 21-General ---------------------------------------------------------------------- OC DelGuy · 2021-01-29 21:17 So I was trying to learn how to use Canvas.  So I started just making shapes and stuff but ran into this: (see pic).  Why is there a line from the end of the Canvas.Line(0,200,250,250); command to the beginning of the Canvas.AngleArc(AngleArcX,AngleArcY,Radius,StartAngle,EndAngle); command? ---------------------------------------------------------------------- wp · 2021-01-29 21:59 This is intentional, I found this (https://docs.microsoft.com/en- us/windows/win32/api/wingdi/nf-wingdi-anglearc): "The AngleArc function draws a line segment and an arc. The line segment is drawn from the current position to the beginning of the arc. The arc is drawn along the perimeter of a circle with the given radius and center. The length of the arc is defined by the given start and sweep angles." The function is intended for drawing pie charts, like in this example: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormPaint(Sender: TObject);begin  Canvas.Pen.Width := 2;   Canvas.MoveTo(300, 300);  Canvas.AngleArc(300, 300, 200, 0, 90);  Canvas.MoveTo(300, 300);  Canvas.AngleArc(300, 300, 200, 90, 30);  Canvas.MoveTo(300, 300);  Canvas.AngleArc(300, 300, 200, 120, 90);  Canvas.MoveTo(300, 300);  Canvas.AngleArc(300, 300, 200, 210, 70);  Canvas.MoveTo(300, 300);  Canvas.AngleArc(300, 300, 200, 260, 120);end; ---------------------------------------------------------------------- OC DelGuy · 2021-01-30 06:28 Quote from: wp on January 29, 2021, 10:59:06 pmThis is intentional Thanks!  Your answer with the code you put up was great.  I copied the code to my program and ran it and i understood perfectly what you meant! Is there a command for drawing just the arc without the radius line? ---------------------------------------------------------------------- howardpc · 2021-01-30 09:12 TCanvas.Arc draws a segment of an ellipse's circumference. The ellipse (circle is a special case) is given by the rectangle bounding it, and the starting and ending sweep angle are given in 1/16 of a degree units. Arc(aLeft, aTop, aRight, aBottom, angle16Deg, angle16DegLength: Integer); As alternative parameters to the angle you can give two lines which start at the centre of the ellipse and intersect the ellipse circumference at the ends of the arc. ---------------------------------------------------------------------- wp · 2021-01-30 10:21 I must correct myself. I think now that the motivation to introduce the AngleArc procedure was drawing rounded rectangles (or polygons) rather than pie charts: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FormPaint(Sender: TObject);begin  Canvas.Pen.Width := 2;  Canvas.MoveTo(200, 500);  Canvas.AngleArc(400, 400, 100, 270, 90);  Canvas.AngleArc(400, 200, 100, 0, 90);  Canvas.AngleArc(200, 200, 100, 90, 90);  Canvas.AngleArc(200, 400, 100, 180, 90);end;