3 Жанауартану пәнінен мультимедиалық анимация процессін жасау
3.1 Бағдарламаны іске асыру
Delphi программалау ортасын ашамыз керекті компененттерді алып, бағдарламаның негізгі формасын жасаймыз
11 сурет – Негізгі бет
Interface
Uses
windows, messages, sysutils, variants, classes, graphics, controls, forms,
dialogs, mplayer, stdctrls, extctrls;
Type
tform1 = class(tform)
image1: timage;
label1: tlabel;
mediaplayer1: tmediaplayer;
panel1: tpanel;
label2: tlabel;
timer1: ttimer;
label3: tlabel;
procedure formcreate(sender: tobject);
procedure label1click(sender: tobject);
procedure timer1timer(sender: tobject);
private
{ private declarations }
public
{ public declarations }
end;
Var
form1: tform1;
Implementation
Uses unit2;
{$r *.dfm}
Procedure tform1.formcreate(sender: tobject);
Begin
mediaplayer1.filename:=('12.wmv');
mediaplayer1.open;
mediaplayer1.play
end;
Procedure tform1.label1click(sender: tobject);
Begin
mediaplayer1.filename:=('sound\12.wmv');
mediaplayer1.close;
form1.visible:=false;
form2.showmodal;
End;
procedure tform1.timer1timer(sender: tobject);
Begin
12 сурет – Қосымша бет
unit unit2;
interface
uses
windows, messages, sysutils, variants, classes, graphics, controls, forms,
dialogs, stdctrls, extctrls, olectrls, shockwaveflashobjects_tlb;
type
tform2 = class(tform)
image1: timage;
label1: tlabel;
label2: tlabel;
label3: tlabel;
label4: tlabel;
label5: tlabel;
image2: timage;
label6: tlabel;
procedure label1click(sender: tobject);
procedure label2click(sender: tobject);
procedure label3click(sender: tobject);
procedure image1click(sender: tobject);
procedure label5click(sender: tobject);
procedure image2click(sender: tobject);
procedure label4click(sender: tobject);
private
{ private declarations }
public
{ public declarations }
end;
var
form2: tform2;
implementation
uses unit3, unit4, unit5, unit6, unit7, unit1, unit8;
{$r *.dfm}
procedure tform2.label1click(sender: tobject);
begin
form3.showmodal;
end;
procedure tform2.label2click(sender: tobject);
begin
form4.showmodal;
end;
procedure tform2.label3click(sender: tobject);
begin
form5.showmodal;
end;
procedure tform2.image1click(sender: tobject);
begin
//form6.showmodal;
end;
procedure tform2.label5click(sender: tobject);
begin
close
end;
procedure tform2.image2click(sender: tobject);
begin
form8.showmodal;
end.
13 сурет – Анимациялық бет
unit unit3;
interface
uses
windows, messages, sysutils, variants, classes, graphics, controls, forms,
dialogs, olectrls, shockwaveflashobjects_tlb, stdctrls, comctrls,
extctrls;
type
tform3 = class(tform)
button1: tbutton;
flash1: tshockwaveflash;
trackbar1: ttrackbar;
open1: topendialog;
procedure button1click(sender: tobject);
procedure formclose(sender: tobject; var action: tcloseaction);
private
{ private declarations }
public
{ public declarations }
end;
var
form3: tform3;
implementation
{$r *.dfm}
procedure tform3.button1click(sender: tobject);
begin
flash1.visible:=true;
if open1.execute then begin
flash1.movie:=open1.filename;
trackbar1.max:=flash1.totalframes;
end;
end;
procedure tform3.formclose(sender: tobject; var action: tcloseaction);
begin
flash1.stop;
end;
end.
14 сурет – Видеофрагменттерді көрсету беті
unit Unit4;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, MPlayer, ExtCtrls, StdCtrls;
type
TForm4 = class(TForm)
Image1: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Image5: TImage;
Image6: TImage;
Image7: TImage;
Image8: TImage;
Panel1: TPanel;
MediaPlayer1: TMediaPlayer;
Timer1: TTimer;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
procedure Image1Click(Sender: TObject);
procedure Image2Click(Sender: TObject);
procedure Image8Click(Sender: TObject);
procedure Image4Click(Sender: TObject);
procedure Image5Click(Sender: TObject);
procedure Image6Click(Sender: TObject);
procedure Image7Click(Sender: TObject);
procedure Image3Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
procedure TForm4.Image1Click(Sender: TObject);
begin
MediaPlayer1.FileName:=('11.mpeg');
MediaPlayer1.Open;
MediaPlayer1.Play
end;
procedure TForm4.Image2Click(Sender: TObject);
begin
MediaPlayer1.FileName:=('112.wmv');
MediaPlayer1.Open;
MediaPlayer1.Play
end;
procedure TForm4.Image8Click(Sender: TObject);
begin
MediaPlayer1.FileName:=('113.wmv');
MediaPlayer1.Open;
MediaPlayer1.Play
end;
procedure TForm4.Image4Click(Sender: TObject);
begin
MediaPlayer1.FileName:=('114.wmv');
MediaPlayer1.Open;
MediaPlayer1.Play
end;
procedure TForm4.Image5Click(Sender: TObject);
begin
MediaPlayer1.FileName:=('115.wmv');
MediaPlayer1.Open;
MediaPlayer1.Play
end;
procedure TForm4.Image6Click(Sender: TObject);
begin
MediaPlayer1.FileName:=('116.wmv');
MediaPlayer1.Open;
MediaPlayer1.Play
end;
procedure TForm4.Image7Click(Sender: TObject);
begin
MediaPlayer1.FileName:=('117.wmv');
MediaPlayer1.Open;
MediaPlayer1.Play
end;
procedure TForm4.Image3Click(Sender: TObject);
begin
MediaPlayer1.FileName:=('118.wmv');
MediaPlayer1.Open;
MediaPlayer1.Play
end;
procedure TForm4.Timer1Timer(Sender: TObject);
begin
label2.Left:=label2.Left-1;
if label2.Left=-length(label2.Caption)*12 then label2.Left:=form4.ClientWidth;
label3.Left:=label3.Left-1;
if label3.Left=-length(label3.Caption)*12 then label3.Left:=form4.ClientWidth;
label4.Left:=label4.Left-1;
if label4.Left=-length(label4.Caption)*12 then label4.Left:=form4.ClientWidth;
label1.Left:=label1.Left-1;
if label1.Left=-length(label1.Caption)*12 then label1.Left:=form4.ClientWidth;
end;
procedure TForm4.FormClose(Sender: TObject; var Action: TCloseAction);
begin
MediaPlayer1.Close;
Достарыңызбен бөлісу: |