We help IT Professionals succeed at work.

Can I set size of Windows Media Player control as the size of the video to be played?

hi,

I would like to play a video with its original size.  How can I set the size of the Windows Media Player control according such that the video is displayed 100%?  For AudioVideoPlayback class, it has a .Size property.  Is there a similar property for Windows Media Player control?

Also, is it possible to achieve the same goal with quartz.dll ?
Comment
Watch Question

Chinmay PatelChief Technology Ninja
Distinguished Expert 2019

Commented:
Hi CodingCat,
Yes you can easily do that.

See second post in this thread :

http://social.msdn.microsoft.com/Forums/en/vbide/thread/8aba13b0-af4d-477b-ba44-f718e0c73304
Regards,
Chinmay


Author

Commented:
hi,

the uiMode property can only set the video size based on the size of the Windows Media Player control.  Can I play the video as the original size and make the size of the WMP control adjust its size accordingly?

For example, if the video is 800x600, the WMP will play it in a 800x600 size rectangle. if the next video is 400x300, the WMP change its size to 400x300 as well and play the video.  Is it achievable?  stretchToFit() does not accomplish this either.
Chief Technology Ninja
Distinguished Expert 2019
Commented:
Sure.
Check these two properties :
http://msdn.microsoft.com/en-us/library/dd564796(VS.85).aspx
http://msdn.microsoft.com/en-us/library/dd564797(VS.85).aspx
Load Media, Read this property and then resize your control and your Window accordingly.
Regards,
Chinmay


Author

Commented:
Thanks.  That works for me.
Chinmay PatelChief Technology Ninja
Distinguished Expert 2019

Commented:
Glad I could help. :)