
Implementation
{$R *.dfm}
procedure ris(color:Tcolor);
begin
with form1.canvas do begin
pen.color:=color;
rectangle(x+10,y+150,x+25,y+160);
rectangle(x+25,y+130,x+117,y+160);
ellipse(x+30,y+145,x+60,y+170);
ellipse(x+80,y+145,x+110,y+170);
moveto(x+40,y+130);
lineto(x+55,y+110);
lineto(x+85,y+110);
lineto(x+100,y+130);
end;
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
x:=0;
y:=0;
Timer1.Interval:=1;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
ris(form1.color);
if x<Form1.ClientWidth
then begin x:=x+5;
y:=y+1;
ris(clBlue);
end;
else begin
x:=x-800;
y:=y-100;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
form1.Close;
end;
end.
5.2Лаба
unit Unit3;
Interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, jpeg;
type
TForm1 = class(TForm)
Image1: TImage;
RadioGroup1: TRadioGroup;
procedure RadioGroup1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
Implementation
{$R *.dfm}
procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
case Radiogroup1.ItemIndex of
0:Image1.Picture.LoadFromFile('D:\зима.jpg');
1:Image1.Picture.LoadFromFile('D:\весна.jpg');
2:Image1.Picture.LoadFromFile('D:\лето.jpg');
3:Image1.Picture.LoadFromFile('D:\осень.jpg');
end;
end;
end.