unit ShowAVI_;
interface
uses
Windows, Messages, SysUtils,
Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, ComCtrls, ExtCtrls;
type
TForm1 = class(TForm)
Animate1: TAnimate;
// Animate компоненті
Button1: TButton; // Пуск-Стоп батырмасы
Button2: TButton; // келесі кадр
Button3: TButton; // алдыңғы кадр
RadioButton1: TRadioButton;
// барлық анимацияны қарап шығу
RadioButton2: TRadioButton;
// әр кадр бойынша қарап шығу
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure RadioButton1Click(Sender: TObject);
procedure RadioButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations )
end;
var Form1: TForm1; // форма
CFrame: integer;
implementation {$R *.DFM}
procedure TForm1.Button2Click(Sender: TObject);
begin
if CFrame = 1
then
Button2.Enabled := True;
if CFrame < Animate1.FrameCount
then begin
CFrame := CFrame + 1;
Animate1.StartFrame := CFrame;
Animate1.StopFrame := CFrame;
Animate1.Active := True;
if CFrame = Animatel.FrameCount
then Button2.Enabled:=False;
end;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
if CFrame = Animate1.FrameCount
then Button2.Enabled := True;
if CFrame > 1
then begin
CFrame := CFrame — 1;
Animate1.StartFrame := CFrame;
Animate1.StopFrame := CFrame;
Animate1.Active := True;
if CFrame = 1 // текущий кадр — первый
then Form1.Button3.Enabled := False;
end;
end;
procedure TForml.RadioButtonlClick(Sender: TObject);
begin
Buttonl.Enabled:=True;
Form1.Button3.Enabled:=False ;
Form1.Button2.Enabled:=False;
end;
procedure TForm1.RadioButton2Click(Sender:TObject);
begin
Button2.Enabled:=True;
Buttons.Enabled:=False
Buttonl.Enabled:=False; end;
procedure TForm1.ButtonlClick(Sender: TObject);
begin
if Animate1.Active = False
then begin
Animate1.StartFrame:=l;
Animate1.StopFrame:=Animate1.FrameCount;
Animate1.Active:=True;
Button1.caption:='Стоп';
RadioButton2.Enabled:=False;
end
else
begin
Animate1.Active:=False;
Button1.caption:='Пуск';
RadioButton2.Enabled:=True;
end;
end;
end.