首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

winfrom获取视频宽高的有关问题

2012-04-15 
winfrom获取视频宽高的问题自己写了一个视频播放器想窗体的大小根据视频原始尺寸来控制int intWidth wmp

winfrom获取视频宽高的问题
自己写了一个视频播放器
想窗体的大小根据视频原始尺寸来控制
int intWidth = wmp.currentMedia.imageSourceWidth;
int intHeight = wmp.currentMedia.imageSourceHeight;

我这个是获取视频的宽高。
但是我调试过的。。这个宽度一直是0.不知道为什么。差了很久不知道怎么弄
用的是windowsmediaplayer控件

[解决办法]
IWMPMedia mediaInfo = axWindowsMediaPlayer1.newMedia("c:\\1.avi");

axWindowsMediaPlayer1.currentMedia = mediaInfo;
int intWidth = axWindowsMediaPlayer1.currentMedia.imageSourceWidth;
int intHeight = axWindowsMediaPlayer1.currentMedia.imageSourceHeight;
axWindowsMediaPlayer1.Width = intWidth ;
axWindowsMediaPlayer1.Height = intHeight ;

热点排行