用的控件是windowsmediaplayer,在窗体初始化是不成功
Private Sub Form_Load()
wmp.Url = "D:\work\test\kajin\test.wmv"
me.Height = wmp.currentMedia.ImageSourceWidth * 15
me.Width = wmp.currentMedia.ImageSourceHeight * 15
End Sub
我主要是想让窗体自适应视频文件的大小,但是窗体总是 0 ,调试的时候 wmp.currentMedia.ImageSourceWidth 是有值的,按调试模式一步步来可以自己适应,当把调试去掉后 wmp.currentMedia.ImageSourceWidth 又取不到值了,请问是什么原因啊?
Private Sub Form_Load()
wmp.Url = "D:\work\test\kajin\test.wmv"
me.Height = wmp.currentMedia.ImageSourceWidth * 15
me.Width = wmp.currentMedia.ImageSourceHeight * 15
End Sub
我主要是想让窗体自适应视频文件的大小,但是窗体总是 0 ,调试的时候 wmp.currentMedia.ImageSourceWidth 是有值的,按调试模式一步步来可以自己适应,当把调试去掉后 wmp.currentMedia.ImageSourceWidth 又取不到值了,请问是什么原因啊?
playState:integer; 播放状态,1=停止,2=暂停,3=播放,6=正在缓冲,9=正在连接,10=准备就绪
现在又有新的问题了,我如何监测它是否加载完了呢?用timer控件监测吗?
像这样?Private Sub Timer1_Timer()
If wmp.playstate = 3 Then
Me.Width = wmp.currentMedia.ImageSourceWidth * 15
Me.Height = wmp.currentMedia.ImageSourceHeight * 15
End If
End Sub是这样吧?