使用AxWindowsMediaPlayer控件的技巧
axWindowsMediaPlayer1.Play播放
axWindowsMediaPlayer1.Stop停止 axWindowsMediaPlayer1.Pause暂停 axWindowsMediaPlayer1.PlayCount文件播放次数 axWindowsMediaPlayer1.AutoRewind是否循环播放 axWindowsMediaPlayer1.Balance声道 axWindowsMediaPlayer1.Volume音量 axWindowsMediaPlayer1.Mute静音 axWindowsMediaPlayer1.EnableContextMenu是否允许在控件上点击鼠标右键时弹出快捷菜单 axWindowsMediaPlayer1.AnimationAtStart是否在播放前先播放动画 axWindowsMediaPlayer1.ShowControls是否显示控件工具栏 axWindowsMediaPlayer1.ShowAudioControls是否显示声音控制按钮 axWindowsMediaPlayer1.ShowDisplay是否显示数据文件的相关信息 axWindowsMediaPlayer1.ShowGotoBar是否显示Goto栏 axWindowsMediaPlayer1.ShowPositionControls是否显示位置调节按钮 axWindowsMediaPlayer1.ShowStatusBar是否显示状态栏 axWindowsMediaPlayer1.ShowTracker是否显示进度条 axWindowsMediaPlayer1.FastForward快进 axWindowsMediaPlayer1.FastReverse快退 axWindowsMediaPlayer1.Rate快进/快退速率 axWindowsMediaPlayer1.AllowChangeDisplaySize是否允许自由设置播放图象大小 axWindowsMediaPlayer1.DisplaySize设置播放图象大小 1-MpDefaultSize原始大小 2-MpHalfSize原始大小的一半 3-MpDoubleSize原始大小的两倍 4-MpFullScreen全屏 5-MpOneSixteenthScreen屏幕大小的1/16 6-MpOneFourthScreen屏幕大小的1/4 7-MpOneHalfScreen屏幕大小的1/2 axWindowsMediaPlayer1.ClickToPlay是否允许单击播放窗口启动MediaPlayer在视频播放之后,可以通过如下方式读取源视频的宽度和高度,然后设置其还原为原始的大小.
private void ResizeOriginal() { int intWidth = axWindowsMediaPlayer1.currentMedia.imageSourceWidth; int intHeight = axWindowsMediaPlayer1.currentMedia.imageSourceHeight; axWindowsMediaPlayer1.Width = intWidth + 2; axWindowsMediaPlayer1.Height = intHeight + 2; }