Jump to content

How to resize video object


CYCho
 Share

Recommended Posts

 

#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 = True
Local $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)
WEnd
If Not $srcFound Or $width = 0 Then
    $oPlayer.Close()
    Exit
Else
    $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)
EndIf

While 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
    EndSwitch
WEnd
$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 by CYCho
Link to comment
Share on other sites

  • 4 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...