Solved: Draw stars inside polygons and Get Rid of extra vertical line lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2024-05-19 07:45 Corrected version is attached in the 4th REPLY BELOW. G'Day All. I converted some CSharp code ( from http://www.csharphelper.com/howtos/howto_draw_ngon_stars.html  ) to Lazarus and have added a scalefactor to scale the smaller images that get drawn around the center image.. I was trying to get rid of a small vertical line at the bottom, which happens for even values of number of vertices but somehow I cannot find how (as shown in the attached picture). How to get rid of that small vertical line is what I am trying to do? Paweld was able to fix this for me in next thread. Thank you Paweld. ---------------------------------------------------------------------- paweld · 2024-05-19 08:46 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.DrawScaledStar(ACanvas: TCanvas; x, y: Integer; orig_pts: array of TPoint; skip: Integer; AscaleFactor: Double);var  pts: array of TPoint;  i, pointIndex: Integer;begin  SetLength(pts, NumPoints);  for i := 0 to NumPoints - 1 do  begin    if (skip * 2) = NumPoints then    continue;    pointIndex := (i * skip) mod NumPoints;    pts[i] := Point(Round(x + orig_pts[pointIndex].X * AscaleFactor), Round(y + orig_pts[pointIndex].Y * AscaleFactor));  end;  for i := 0 to High(pts) - 1 do  begin      ACanvas.Line(pts[i].X, pts[i].Y, pts[i + 1].X, pts[i + 1].Y);  end;  ACanvas.Line(pts[High(pts)].X, pts[High(pts)].Y, pts[0].X, pts[0].Y);end; ---------------------------------------------------------------------- Boleeman · 2024-05-19 09:27 Paweld to the Rescue. "if (skip * 2) = NumPoints then"   Cant believe it. It was driving me crazy, trying to remove that one little vertical line. Thanks for helping me out Paweld. ---------------------------------------------------------------------- 440bx · 2024-05-19 09:34 Quote from: Boleeman on May 19, 2024, 11:27:28 amPaweld to the Rescue. "if (skip * 2) = NumPoints then"   Cant believe it. It was driving me crazy, trying to remove that one little vertical line. Thanks for helping me out Paweld. Just a suggestion: post a corrected version of your program so people don't have to remember that it requires a manual correction to operate properly. ---------------------------------------------------------------------- Boleeman · 2024-05-19 09:38 OK 440bx Attached below is the fixed up version. ---------------------------------------------------------------------- 440bx · 2024-05-19 09:40 Quote from: Boleeman on May 19, 2024, 11:38:34 amOK 440bx Attached below is the fixed up version. Thank you. ---------------------------------------------------------------------- Boleeman · 2024-05-19 09:41 You are welcome 440bx.