Gets the height of the video window.
public virtual float VideoWindowHeight { get; } Public Overridable ReadOnly Property VideoWindowHeight As Single public:virtual property float VideoWindowHeight {float get();}
A value representing the video window height.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public PlayCtrlForm _form = new PlayCtrlForm();public void VideoWindowExample(){// reference the play controlPlayCtrl playctrl = _form.PlayCtrl;// input filestring inFile = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_Source.avi");try{// turn off auto startplayctrl.AutoStart = false;// set the source fileplayctrl.SourceFile = inFile;// get the video window handleIntPtr handle = playctrl.VideoWindow;// get the video and video window infofloat vwt = playctrl.VideoWindowTop;float vwl = playctrl.VideoWindowLeft;float vwh = playctrl.VideoWindowHeight;float vww = playctrl.VideoWindowWidth;float vh = playctrl.VideoHeight;float vw = playctrl.VideoWidth;ScaleMode scm = playctrl.ScaleMode;float sch = playctrl.ScaleHeight;float scw = playctrl.ScaleWidth;float sct = playctrl.ScaleTop;float scl = playctrl.ScaleLeft;SizeMode sm = playctrl.VideoWindowSizeMode;bool isFullScreen = playctrl.FullScreenMode;// check sizes for sizemode settingif (vw > vww && vh > vwh && sm != SizeMode.Fit)playctrl.VideoWindowSizeMode = SizeMode.Fit;else if (vw < vww && vh < vwh)playctrl.VideoWindowSizeMode = SizeMode.Stretch;// set the play control to cover the form's client areaplayctrl.SetVideoWindowPos(0, 0, this._form.ClientSize.Width, this._form.ClientSize.Height);// set the result to what we expect_result = (handle != null);// run the videoplayctrl.Run();}catch (Exception){_result = false;}// we'll loop on the state and pump messages for this example.// but you should not need to if running from a Windows Forms application.while (playctrl.State == PlayState.Running)Application.DoEvents();}static class LEAD_VARS{public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 20\Media";}
Imports LeadtoolsImports Leadtools.MultimediaImports LeadtoolsMultimediaExamples.FixturesPublic _result As Boolean = FalsePublic _form As PlayCtrlForm = New PlayCtrlForm()Public Sub VideoWindowExample()' reference the play controlDim playctrl As PlayCtrl = _form.PlayCtrl' input fileDim inFile As String = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_Source.avi")Try' turn off auto startplayctrl.AutoStart = False' set the source fileplayctrl.SourceFile = inFile' get the video window handleDim handle As IntPtr = playctrl.VideoWindow' get the video and video window infoDim vwt As Single = playctrl.VideoWindowTopDim vwl As Single = playctrl.VideoWindowLeftDim vwh As Single = playctrl.VideoWindowHeightDim vww As Single = playctrl.VideoWindowWidthDim vh As Single = playctrl.VideoHeightDim vw As Single = playctrl.VideoWidthDim scm As ScaleMode = playctrl.ScaleModeDim sch As Single = playctrl.ScaleHeightDim scw As Single = playctrl.ScaleWidthDim sct As Single = playctrl.ScaleTopDim scl As Single = playctrl.ScaleLeftDim sm As SizeMode = playctrl.VideoWindowSizeModeDim isFullScreen As Boolean = playctrl.FullScreenMode' check sizes for sizemode settingIf vw > vww AndAlso vh > vwh AndAlso sm <> SizeMode.Fit Thenplayctrl.VideoWindowSizeMode = SizeMode.FitElseIf vw < vww AndAlso vh < vwh Thenplayctrl.VideoWindowSizeMode = SizeMode.StretchEnd If' set the play control to cover the form's client areaplayctrl.SetVideoWindowPos(0, 0, Me._form.ClientSize.Width, Me._form.ClientSize.Height)' set the result to what we expect_result = (handle <> Nothing)' run the videoplayctrl.Run()Catch e1 As Exception_result = FalseEnd Try' we'll loop on the state and pump messages for this example.' but you should not need to if running from a Windows Forms application.Do While playctrl.State = PlayState.RunningApplication.DoEvents()LoopEnd SubPublic NotInheritable Class LEAD_VARSPublic Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 20\Media"End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
