Interactive open polygon without array of pointtype using ptcmouse lazarus / 39-Graphics ---------------------------------------------------------------------- TBMan · 2025-02-19 14:10 This routine uses ptcgraph, ptccrt and ptcmouse.  I couldn't get the drawpoly routine in ptcgraph to work so I made my own, even without the mouse selection of points. Thinking back I'm wondering if I had to pass a pointer to the var polypoints, instead of the array itself. Anyway, this works. 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 { Select the first point with the left mouse button, then select the subsequent points using the right mouse button and thenclose the polygon with a keypress} procedure Poly(Paintcolor:byte);  var    GotFirst,    First: boolean;    fx, fy, mxx, myy, mx, my, mb: longint;  begin    First := True;    GotFirst := false;    setcolor(paintcolor);    repeat      getmousestate(mx, my, mb);       if lpressed and not gotfirst then   {allow only one left mouse click}      begin        mxx := mx;        myy := my;        if First then        begin          fx := mx;       {save starting points}          fy := my;          First := False;        putpixel(fx, fy, paintcolor);        end;        GotFirst := true;        while lpressed do  {wait for mouse release}        begin        end;      end;       if rpressed then    {set subsequent points with right mouse clicks}      begin        line(mx, my, mxx, myy);      mxx := mx;        myy := my;        while rpressed do   {wait for mouse release}        begin        end;      end;     until keypressed;    line(mxx, myy, fx, fy);  {close the polygon}     end;