在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
非常好用的DELPHI相册播放源代码 unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, LMDCustomControl, LMDCustomPanel, LMDCustomBevelPanel, LMDSimplePanel, jpeg, ExtCtrls, LMDCustomParentPanel, LMDBackPanel, FileCtrl, ComCtrls, Spin, RzSpnEdt;
type TForm1 = class(TForm) Timer1: TTimer; Button2: TButton; Label1: TLabel; LMDSimplePanel2: TLMDSimplePanel; LMDSimplePanel1: TLMDSimplePanel; Image2: TImage; Image3: TImage; FileListBox1: TFileListBox; Timer2: TTimer; RadioGroup1: TRadioGroup; Label2: TLabel; RzSpinner1: TRzSpinner; Timer3: TTimer; Edit1: TEdit; procedure Timer1Timer(Sender: TObject); procedure Button2Click(Sender: TObject); procedure LMDSimplePanel2Move(Sender: TObject); procedure LMDSimplePanel1Move(Sender: TObject); procedure FormShow(Sender: TObject); procedure FileListBox1Click(Sender: TObject); procedure Timer2Timer(Sender: TObject); procedure RzSpinner1Change(Sender: TObject); procedure Timer3Timer(Sender: TObject); procedure Edit1Change(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Timer1Timer(Sender: TObject); var times,i:word; begin case RadioGroup1.ItemIndex of 0: begin if image3.Left=0 then begin edit1.Text:=inttostr(strtoint(edit1.Text)+1); end; if self.LMDSimplePanel1.Left<strtoint(label1.Caption)-self.LMDSimplePanel1.Width then begin self.LMDSimplePanel1.Left:=strtoint(label1.Caption); end else begin self.LMDSimplePanel1.Visible:=true; self.LMDSimplePanel1.Left:=self.LMDSimplePanel1.Left-1; self.image3.Width:=self.LMDSimplePanel1.Width; self.image3.Height:=self.LMDSimplePanel1.Height; self.image3.Top:=self.LMDSimplePanel1.Top; self.image3.Left:=self.LMDSimplePanel1.Left+self.image3.Width; end; end; 1: begin if self.LMDSimplePanel1.Left=(self.LMDSimplePanel1.Width) then begin edit1.Text:=inttostr(strtoint(edit1.Text)+1); end; if self.LMDSimplePanel1.Left>strtoint(label1.Caption)+self.LMDSimplePanel1.Width then begin self.LMDSimplePanel1.Left:=strtoint(label1.Caption); end else begin self.LMDSimplePanel1.Visible:=true; self.LMDSimplePanel1.Left:=self.LMDSimplePanel1.Left+1; self.image3.Width:=self.LMDSimplePanel1.Width; self.image3.Height:=self.LMDSimplePanel1.Height; self.image3.Top:=self.LMDSimplePanel1.Top; self.image3.Left:=self.LMDSimplePanel1.Left-self.image3.Width; end; end; 2: begin if image3.top=0 then begin edit1.Text:=inttostr(strtoint(edit1.Text)+1); end; if self.LMDSimplePanel1.top>strtoint(label2.Caption)+self.LMDSimplePanel1.Height then begin self.LMDSimplePanel1.Top:=strtoint(label2.Caption); end else begin self.LMDSimplePanel1.Visible:=true; self.LMDSimplePanel1.Left:=self.LMDSimplePanel1.Left; self.LMDSimplePanel1.top:=self.LMDSimplePanel1.top+1; self.image3.Width:=self.LMDSimplePanel1.Width; self.image3.Height:=self.LMDSimplePanel1.Height; self.image3.Left:=self.LMDSimplePanel1.Left; self.image3.Top:=self.LMDSimplePanel1.Top-self.image3.Height; end; end; 3: begin if (self.LMDSimplePanel1.top=0 ) or (image3.top=-self.image3.Height) then begin edit1.Text:=inttostr(strtoint(edit1.Text)+1); end; if self.LMDSimplePanel1.top<strtoint(label2.Caption)-self.LMDSimplePanel1.Height then begin self.LMDSimplePanel1.Top:=strtoint(label2.Caption); end else begin self.LMDSimplePanel1.Visible:=true; self.LMDSimplePanel1.Left:=self.LMDSimplePanel1.Left; self.LMDSimplePanel1.top:=self.LMDSimplePanel1.top-1; self.image3.Width:=self.LMDSimplePanel1.Width; self.image3.Height:=self.LMDSimplePanel1.Height; self.image3.Left:=self.LMDSimplePanel1.Left; self.image3.Top:=self.LMDSimplePanel1.Top+self.image3.Height; end; end; end; self.Timer1.Enabled:=true; end;
procedure TForm1.Button2Click(Sender: TObject); begin application.ProcessMessages; edit1.Text:='0'; image2.Picture.LoadFromFile(ExtractFileDir(ParamStr(0))+'\pic\'+self.FileListBox1.Items[0]); image3.Picture.LoadFromFile(ExtractFileDir(ParamStr(0))+'\pic\'+self.FileListBox1.Items[1]); timer1.Enabled:=not timer1.Enabled; timer2.Enabled:=not timer1.Enabled; label1.Caption:=inttostr(self.LMDSimplePanel1.Left); label2.Caption:=inttostr(self.LMDSimplePanel1.top); self.LMDSimplePanel1.Visible:=not timer2.Enabled; if timer1.Enabled=true then begin button2.Caption:='停止'; end else begin button2.Caption:='开始播放'; end; end;
procedure TForm1.LMDSimplePanel2Move(Sender: TObject); begin self.LMDSimplePanel1.Left:=0; self.LMDSimplePanel1.Top:=0; self.LMDSimplePanel1.Width:=self.LMDSimplePanel2.Width; self.LMDSimplePanel1.Height:=self.LMDSimplePanel2.Height; image3.Left:=0; image3.Top:=0; image3.Width:=self.LMDSimplePanel2.Width; image3.Height:=self.LMDSimplePanel2.Height; end;
procedure TForm1.LMDSimplePanel1Move(Sender: TObject); begin self.LMDSimplePanel1.Left:=0; self.LMDSimplePanel1.Top:=0; self.LMDSimplePanel1.Width:=self.LMDSimplePanel2.Width; self.LMDSimplePanel1.Height:=self.LMDSimplePanel2.Height; image3.Left:=0; image3.Top:=0; image3.Width:=self.LMDSimplePanel2.Width; image3.Height:=self.LMDSimplePanel2.Height; end;
procedure TForm1.FormShow(Sender: TObject); begin FileListBox1.Directory:=ExtractFileDir(ParamStr(0))+'\pic'; // self.LMDSimplePanel1.Left:=0; self.LMDSimplePanel1.Top:=0; self.LMDSimplePanel1.Width:=self.LMDSimplePanel2.Width; self.LMDSimplePanel1.Height:=self.LMDSimplePanel2.Height; image3.Left:=0; image3.Top:=0; image3.Width:=self.LMDSimplePanel2.Width; image3.Height:=self.LMDSimplePanel2.Height; end;
procedure TForm1.FileListBox1Click(Sender: TObject); begin image3.Picture.LoadFromFile(self.FileListBox1.FileName); end;
procedure TForm1.Timer2Timer(Sender: TObject); begin self.LMDSimplePanel1.Left:=0; self.LMDSimplePanel1.Top:=0; self.LMDSimplePanel1.Width:=self.LMDSimplePanel2.Width; self.LMDSimplePanel1.Height:=self.LMDSimplePanel2.Height; image3.Left:=0; image3.Top:=0; image3.Width:=self.LMDSimplePanel2.Width; image3.Height:=self.LMDSimplePanel2.Height; end;
procedure TForm1.RzSpinner1Change(Sender: TObject); begin timer1.Interval:=self.RzSpinner1.Value*5; if self.RzSpinner1.Value=0 then begin self.LMDSimplePanel1.Visible:=false; self.Image3.left:=0; self.Image3.Top:=0; end; end;
procedure TForm1.Timer3Timer(Sender: TObject); begin {image2.Picture.LoadFromFile(ExtractFileDir(ParamStr(0))+'\pic\'+self.FileListBox1.Items[FileListBox1.count-FileListBox1.count]); image3.Picture.LoadFromFile(ExtractFileDir(ParamStr(0))+'\pic\'+self.FileListBox1.Items[FileListBox1.count-FileListBox1.count+1]); } end;
procedure TForm1.Edit1Change(Sender: TObject); begin if edit1.Text=inttostr(self.FileListBox1.Count) then begin edit1.Text:='1'; end; if edit1.Text<>'0' then begin image3.Picture.LoadFromFile(ExtractFileDir(ParamStr(0))+'\pic\'+self.FileListBox1.Items[strtoint(edit1.Text)]); image2.Picture.LoadFromFile(ExtractFileDir(ParamStr(0))+'\pic\'+self.FileListBox1.Items[strtoint(edit1.Text)-1]); end; end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论