C#
VB
C++
Gets or sets the current video window size mode.
public virtual SizeMode VideoWindowSizeMode { get; set; } Public Overridable Property VideoWindowSizeMode As Leadtools.Multimedia.SizeMode public:virtual property Leadtools.Multimedia.SizeMode VideoWindowSizeMode {Leadtools.Multimedia.SizeMode get();void set ( Leadtools.Multimedia.SizeMode );}
A SizeMode value representing the video window size mode. the default value is SizeMode.Fit.
The default size mode is SizeMode.Fit. Assignment can raise an error exception. For more information, refer to the Error Codes.
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 19\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 19\Media"End Class
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
