CYCho Posted January 21, 2018 Posted January 21, 2018 (edited) #include <GUIConstants.au3>#include <WindowsConstants.au3>Local $oPlayer, $gVideo, $width, $height$oPlayer = ObjCreate("WMPlayer.OCX.7")$oPlayer.URL = 'http://www.clubbalcony.com/upload/culture/yong(2).wmv'Local $srcFound = TrueLocal $time1 = TimerInit()While 1 If $oPlayer.playState() = 3 Then $width = $oPlayer.currentMedia.imageSourceWidth $height = $oPlayer.currentMedia.imageSourceHeight ExitLoop EndIf If TimerDiff($time1) > 5000 Then $srcFound = False ExitLoop EndIf Sleep(50)WEndIf Not $srcFound Or $width = 0 Then $oPlayer.Close() ExitElse $gVideo = GUICreate("Video Control", $width, $height+63, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX), $WS_EX_TOPMOST) GUICtrlCreateObj($oPlayer, 0, 0, $width, $height+63) $oPlayer.uiMode = "Full" $oPlayer.stretchToFit = True GUISetState(@SW_SHOW, $gVideo)EndIfWhile 1 $Msg = GUIGetMsg(1) Switch $Msg[0] Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_RESIZED ;This is where I want to resize the video image to fit the new window size EndSwitchWEnd$oPlayer.Close() How should I code the $GUI_EVENT_RESIZED portion to resize the video to fit the resized window? Your help will be greatly appreciated. Edited January 21, 2018 by CYCho zPlayer - A Small Audio and Video Player
CYCho Posted March 19, 2022 Author Posted March 19, 2022 I found a solution and applied it to my zPlayer. Please download it and take a loot at _CreateWMPObj and ResizeWMP functions at the end of the source code. zPlayer - A Small Audio and Video Player
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now