unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, XPMan; type TForm1 = class(TForm) Button1: TButton; Button2: TButton; Button3: TButton; Timer1: TTimer; XPManifest1: TXPManifest; procedure Romb(x,y:integer; kx,ky:real); procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation const x1 = 100; y1 = 300; x2 = 300; y2 = 300; dx = 20; dy = 40; var x,y:integer; r:real = 30.0; kx:real = 1.0; ky:real = 1.0; a:real = 0; {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin timer1.interval := 50; timer1.enabled := false; Form1.color := clwhite; end; procedure TForm1.Romb(x,y:integer; kx,ky:real); var xx, yy : integer; begin xx := round( dx * kx ); yy := round( dy * ky ); canvas.MoveTo(x-xx, y); canvas.LineTo(x, y+yy); canvas.LineTo(x+xx, y); canvas.LineTo(x, y-yy); canvas.LineTo(x-xx, y); end; procedure TForm1.Button1Click(Sender: TObject); begin canvas.FillRect(canvas.ClipRect); Romb(x1, y1, 1, 1); end; procedure TForm1.Button2Click(Sender: TObject); begin kx := 1.0; ky := 1.0; a := 0.0; canvas.FillRect(canvas.ClipRect); Timer1.Enabled := true; end; procedure TForm1.Timer1Timer(Sender: TObject); begin kx := kx*0.999; ky := ky*0.999; x := x2+round(r*cos(a)); y := y2+round(r*sin(a)); canvas.pen.color := clwhite; canvas.pen.Width := 3; Romb(x, y, kx, ky); a := a+0.1; x := x2+round(r*cos(a)); y := y2+round(r*sin(a)); canvas.pen.Width := 1; canvas.pen.color := clblack; Romb(x, y, kx, ky); end; procedure TForm1.Button3Click(Sender: TObject); begin close; end; end.