| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 619 人关注过本帖
标题:[求助]播放器无法实现全屏播放
只看楼主 加入收藏
zidan365
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2006-5-8
收藏
 问题点数:0 回复次数:0 
[求助]播放器无法实现全屏播放
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, Menus, MPlayer;

type
TForm1 = class(TForm)
OpenDialog1: TOpenDialog;
Timer1: TTimer;
MediaPlayer1: TMediaPlayer;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
Panel1: TPanel;
procedure N2Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N6Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure Panel1Resize(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.N2Click(Sender: TObject);
begin
//OpenDialog.FileName:='*.avi'; //设置被打开文件的扩展名
if OpenDialog1.Execute then
begin
Mediaplayer1.Close;//关闭
MediaPlayer1.Filename:=OpenDialog1.FileName;
//FileNameLabel.Caption:='当前播放文件:'
// +ExtractFileName(OpenDialog.FileName);
MediaPlayer1.Open;
//Form2:=TForm2.Create(Application);
//Form2.Show;
MediaPlayer1.display:=Panel1;
mediaplayer1.DisplayRect:=rect(0,0,Panel1.Width,Panel1.Height);
MediaPlayer1.Play;
MediaPlayer1.Next;
//EndPositon:=MediaPlayer1.Position;
MediaPlayer1.Rewind;
if MediaPlayer1.Mode=mpPaused then
begin
MediaPlayer1.Resume;
end
else
begin
MediaPlayer1.Open;
//Form2:=Tform2.Create(Application);
//Form2.Show;
MediaPlayer1.display:=Panel1;
mediaplayer1.DisplayRect:=rect(0,0,Panel1.Width,Panel1.Height);
MediaPlayer1.Play;
end;
Timer1.Enabled:=True;

end;
end;
procedure TForm1.N3Click(Sender: TObject);
begin
close;
end;

procedure TForm1.N5Click(Sender: TObject);
begin
if MediaPlayer1.Mode=mpPaused then
begin
MediaPlayer1.Resume;
end
else
begin
MediaPlayer1.Open;
MediaPlayer1.display:=Panel1;
mediaplayer1.DisplayRect:=rect(0,0,Panel1.Width,Panel1.Height);
MediaPlayer1.Play;
end;
Timer1.Enabled:=True;
end;


procedure TForm1.N6Click(Sender: TObject);
begin
MediaPlayer1.Pause;
end;

procedure TForm1.N7Click(Sender: TObject);
begin
MediaPlayer1.Rewind;
MediaPlayer1.Play;
end;

procedure TForm1.Panel1Resize(Sender: TObject);
begin

end;

end.
这是我的程序,我先是用PANEL1作为播放区域的,想实现鼠标可以把屏幕拖大拖小,是拖FORM,屏幕随着变大变小,这就是那的程序,我刚请教一朋友,说在Panel1Resize里编写
mediaplayer1.align:=alClient;
form1.activecontrol:=nil;
form1.activecontrol:=mediaplayer1;
可是我写上了,他说可以实现屏幕随FORM的大小变大变小,可是我写上不管用,FORM可以拖大,但是屏幕就是固定的,不能变大变小,麻烦大家给看看
搜索更多相关主题的帖子: 播放器 
2006-05-08 22:39
快速回复:[求助]播放器无法实现全屏播放
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.044142 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved