1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| Const
Liste: Array[1..20] Of Integer = (
10, 25, 35, 2, 12, 28, 7, 15, 18, 10,
12, 15, 26, 14, 20, 35, 17, 23, 8, 20);
{----------------------------------------------------------------}
Procedure TForm1.FormPaint(Sender: TObject);
Const
Larg = 2; // Espace entre les points div 3
Var
i, A, B, C: Integer;
P: Array[1..4] Of TPoint;
Begin
Canvas.Pen.Width := 2;
Canvas.Pen.Color := clRed;
For i := Low(Liste) + 1 To High(Liste) Do
Begin
A := Liste[i - 1];
C := Liste[i];
B := (A + C) Div 2;
P[1] := Point((i - 1) * Larg * 3 + Larg * 0, A);
P[2] := Point((i - 1) * Larg * 3 + Larg * 1, B);
P[3] := Point((i - 1) * Larg * 3 + Larg * 2, C);
P[4] := Point((i - 1) * Larg * 3 + Larg * 3, C);
PolyBezier(Canvas.Handle, P, 4);
End;
Canvas.Pen.Color := clBlue;
Canvas.Pen.Width := 3;
For i := Low(Liste) To High(Liste) Do
Begin
Canvas.Ellipse(
i * Larg * 3 - 1, Liste[i] - 1,
i * Larg * 3 + 1, Liste[i] + 1);
End;
End; |
Partager