Sets the position and size of the video window.
Public Overridable Sub SetVideoWindowPos( _ByVal left As Single, _ByVal top As Single, _ByVal width As Single, _ByVal height As Single _)
left
X-coordinate of the origin of the video window in pixels with respect to the screen.
top
Y-coordinate of the origin of the video window in pixels with respect to the screen.
width
Video window width in pixels
height
Video window height in pixels
Sets the position and size of the video window.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public CaptureCtrlForm _form = new CaptureCtrlForm();public CaptureCtrl _capturectrl;public void SetVideoWindowPosExample(){// reference the capture control_capturectrl = _form.CaptureCtrl;// output filestring outFile = Path.Combine(LEAD_VARS.MediaDir, "CaptureCtrl_SetVideoWindowPosExample.avi");try{// select a video capture deviceif (_capturectrl.VideoDevices["USB"] == null)throw new Exception("No USB video device available");_capturectrl.VideoDevices["USB"].Selected = true;// set a video compressor for the capture file_capturectrl.VideoCompressors.Mpeg4.Selected = true;// set the preview on_capturectrl.Preview = true;// set start event handler_capturectrl.Started += new EventHandler(CaptureCtrl_Started);// set the video window position_capturectrl.SetVideoWindowPos(10, 10, 50, 50);// set the target output_capturectrl.TargetFile = outFile;// start the capture_capturectrl.StartCapture(CaptureMode.Video);}catch (Exception){_result = false;}}void CaptureCtrl_Started(object sender, EventArgs e){// check the current position and set the result to what we expect_result = (_capturectrl.VideoWindowTop == 10 && _capturectrl.VideoWindowLeft == 10&& _capturectrl.VideoWindowWidth == 50 && _capturectrl.VideoWindowWidth == 50);// stop the capture_capturectrl.StopCapture();}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 CaptureCtrlForm = New CaptureCtrlForm()Public _capturectrl As CaptureCtrlPublic Sub SetVideoWindowPosExample()' reference the capture control_capturectrl = _form.CaptureCtrl' output fileDim outFile As String = Path.Combine(LEAD_VARS.MediaDir, "CaptureCtrl_SetVideoWindowPosExample.avi")Try' select a video capture deviceIf _capturectrl.VideoDevices("USB") Is Nothing ThenThrow New Exception("No USB video device available")End If_capturectrl.VideoDevices("USB").Selected = True' set a video compressor for the capture file_capturectrl.VideoCompressors.Mpeg4.Selected = True' set the preview on_capturectrl.Preview = True' set start event handlerAddHandler _capturectrl.Started, AddressOf CaptureCtrl_Started' set the video window position_capturectrl.SetVideoWindowPos(10, 10, 50, 50)' set the target output_capturectrl.TargetFile = outFile' start the capture_capturectrl.StartCapture(CaptureMode.Video)Catch e1 As Exception_result = FalseEnd TryEnd SubPrivate Sub CaptureCtrl_Started(ByVal sender As Object, ByVal e As EventArgs)' check the current position and set the result to what we expect_result = (_capturectrl.VideoWindowTop = 10 AndAlso _capturectrl.VideoWindowLeft = 10 _AndAlso _capturectrl.VideoWindowWidth = 50 _AndAlso _capturectrl.VideoWindowWidth = 50)' stop the capture_capturectrl.StopCapture()End 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
