uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, MPlayer, ExtCtrls, StdCtrls, ComCtrls;
type
TForm1 = class(TForm)
Panel1: TPanel;
MediaPlayer1: TMediaPlayer;
OpenDialog1: TOpenDialog;
Button1: TButton;
TrackBar1: TTrackBar;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
if OpenDialog1.Execute then
with MediaPlayer1 do
begin
Close ;
FileName :=OpenDialog1.FileName ;
Open ;
display:=panel1
DisplayRect :=REct(0,0,Panel1.Width ,Panel1.Height );
notify :=true;
TrackBar1.Position :=length;
end;
end;
为什么播放效果和人家的就不一样呢???