procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
s: String;
function GPI(p: String; n: Byte): Integer;
var
k: Integer;
begin
for k := 2 to n do
if Pos(',', p) > 0 then
Delete(p, 1, Pos(',', p) + 1)
else
Delete(p, 1, Maxint);
if Pos(',', p) > 0 then
Delete(p, Pos(',', p), Maxint);
Result := StrToIntDef(p, 0);
end;
begin
with TStringList.Create, Canvas do
try
Add('0, 141, 415, 133, 286');
Add('0, 133, 286, 265, 288');
Add('0, 265, 288, 143, 410');
Add('0, 143, 410, 270, 420');
Add('0, 270, 420, 261, 291');
Add('0, 261, 291, 207, 194');
Add('0, 207, 194, 138, 281');
Add('0, 138, 281, 268, 419');
Add('0, 228, 228, 230, 190');
Add('0, 230, 190, 253, 191');
Add('0, 253, 191, 246, 252');
Add('1, 237, 165, 264, 142');
Add('1, 243, 119, 279, 95');
Add('1, 246, 66, 296, 37');
Canvas.Pen.Width := 10;
for i := 0 to Count - 1 do
begin
s := Strings[i];
case GPI(s, 1) of
0: begin
MoveTo(GPI(s,2), GPI(s,3));
LineTo(GPI(s, 4), GPI(s, 5))
end;
1: Ellipse(GPI(s,2), GPI(s,3), GPI(s, 4), GPI(s, 5));
end;
Sleep(500);
end;
finally Free end;
end;