I've been searching this quite a while but couldn't get the answer.
I want to draw a polygon on an image, but I want to do this with by creating points;
With the MouseCursor
create this specific points, and with a button draw a line along these points;
I found this:
var
Poly: array of TPoint;
begin
// Allocate dynamic array of TPoint
SetLength(Poly, 6);
// Set array elements
Poly[0] := Point(10, 10);
Poly[1] := Point(30, 5);
Poly[2] := Point(100, 20);
Poly[3] := Point(120, 100);
Poly[4] := Point(50, 120);
Poly[5] := Point(10, 60);
// Pass to drawing routine
Canvas.Polygon(Poly);
// Redim if needed
SetLength(Poly, 7);
Poly[6] := Point(1, 5);
// Pass to drawing routine
Canvas.Polygon(Poly);
end;
This is what I want, but the difference is the Point[1]
, Point[2]
, etc is given by the user with a MouseEvent
.