Forces a frame to the renderer while stopped.
public virtual void Scrub() Public Overridable Sub Scrub() public:virtual void Scrub();
This method has no effect unless the object is in the PlayState.Stopped state. It is usually only useful if you have set AutoScrub to false.
Imports LeadtoolsImports Leadtools.MultimediaImports LeadtoolsMultimediaExamples.FixturesPublic _result As Boolean = FalsePublic _form As PlayCtrlForm = New PlayCtrlForm()Private _duration As Double = 0.0Private _currentPos As Double = -1Public Sub PlayExample()' reference the play controlDim playctrl As PlayCtrl = _form.PlayCtrl' input fileDim inFile As String = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_Source.avi")Try' set autoscrub to falseplayctrl.AutoScrub = False' set autostart to falseplayctrl.AutoStart = False' set our source media fileplayctrl.SourceFile = inFile' this is the location where you can safely install callbacks' force a poster frame if wantedplayctrl.Scrub()' get the reported duration_duration = playctrl.Duration' set event handler to get tracking position changesAddHandler playctrl.TrackingPositionChanged, AddressOf PlayCtrl_TrackingPositionChanged' run it!playctrl.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()Loop' set the result to determine if the reported duration' is the same as the final position from tracking_result = (_duration = _currentPos AndAlso _duration > 0.0)End SubPrivate Sub PlayCtrl_TrackingPositionChanged(ByVal sender As Object, ByVal e As TrackingPositionChangedEventArgs)' get the frame and tracking positions for demonstration onlyDim frame As Integer = _form.PlayCtrl.CurrentFramePositionDim tracking As Integer = _form.PlayCtrl.CurrentTrackingPosition' get the current position_currentPos = Math.Max(_currentPos, _form.PlayCtrl.CurrentPosition)End SubPublic NotInheritable Class LEAD_VARSPublic Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 20\Media"End Class
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public bool _result = false;public PlayCtrlForm _form = new PlayCtrlForm();double _duration = 0.0;double _currentPos = -1;public void PlayExample(){// reference the play controlPlayCtrl playctrl = _form.PlayCtrl;// input filestring inFile =Path.Combine(LEAD_VARS.MediaDir,"PlayCtrl_Source.avi");try{// set autoscrub to falseplayctrl.AutoScrub = false;// set autostart to falseplayctrl.AutoStart = false;// set our source media fileplayctrl.SourceFile = inFile;// this is the location where you can safely install callbacks// force a poster frame if wantedplayctrl.Scrub();// get the reported duration_duration = playctrl.Duration;// set event handler to get tracking position changesplayctrl.TrackingPositionChanged += new TrackingPositionChangedEventHandler(PlayCtrl_TrackingPositionChanged);// run it!playctrl.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();// set the result to determine if the reported duration// is the same as the final position from tracking_result = (_duration == _currentPos && _duration > 0.0);}void PlayCtrl_TrackingPositionChanged(object sender, TrackingPositionChangedEventArgs e){// get the frame and tracking positions for demonstration onlyint frame = _form.PlayCtrl.CurrentFramePosition;int tracking = _form.PlayCtrl.CurrentTrackingPosition;// get the current position_currentPos = Math.Max(_currentPos, _form.PlayCtrl.CurrentPosition);}static class LEAD_VARS{public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 20\Media";}
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
