Gets or sets a value indicating whether the object will automatically force a frame to the renderer while stopped.
public virtual bool AutoScrub {get; set;}
Public Overridable Property AutoScrub As Boolean
true if the object will automatically force a frame to the renderer while stopped; otherwise, false. The default value is true.
Setting this property to false guarantees that no data will be processed when the source is assigned. This makes it possible to install callbacks without missing any data. Call Scrub when you are ready to acquire a poster frame.
Imports Leadtools
Imports Leadtools.Multimedia
Imports LeadtoolsMultimediaExamples.Fixtures
Public _result As Boolean = False
Public _form As PlayCtrlForm = New PlayCtrlForm()
Private _duration As Double = 0.0
Private _currentPos As Double = -1
Public Sub PlayExample()
' reference the play control
Dim playctrl As PlayCtrl = _form.PlayCtrl
' input file
Dim inFile As String = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_Source.avi")
Try
' set autoscrub to false
playctrl.AutoScrub = False
' set autostart to false
playctrl.AutoStart = False
' set our source media file
playctrl.SourceFile = inFile
' this is the location where you can safely install callbacks
' force a poster frame if wanted
playctrl.Scrub()
' get the reported duration
_duration = playctrl.Duration
' set event handler to get tracking position changes
AddHandler playctrl.TrackingPositionChanged, AddressOf PlayCtrl_TrackingPositionChanged
' run it!
playctrl.Run()
Catch e1 As Exception
_result = False
End 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.Running
Application.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 Sub
Private Sub PlayCtrl_TrackingPositionChanged(ByVal sender As Object, ByVal e As TrackingPositionChangedEventArgs)
' get the frame and tracking positions for demonstration only
Dim frame As Integer = _form.PlayCtrl.CurrentFramePosition
Dim tracking As Integer = _form.PlayCtrl.CurrentTrackingPosition
' get the current position
_currentPos = Math.Max(_currentPos, _form.PlayCtrl.CurrentPosition)
End Sub
Public NotInheritable Class LEAD_VARS
Public Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 19\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 control
PlayCtrl playctrl = _form.PlayCtrl;
// input file
string inFile =Path.Combine(LEAD_VARS.MediaDir,"PlayCtrl_Source.avi");
try
{
// set autoscrub to false
playctrl.AutoScrub = false;
// set autostart to false
playctrl.AutoStart = false;
// set our source media file
playctrl.SourceFile = inFile;
// this is the location where you can safely install callbacks
// force a poster frame if wanted
playctrl.Scrub();
// get the reported duration
_duration = playctrl.Duration;
// set event handler to get tracking position changes
playctrl.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 only
int 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 19\Media";
}
Products |
Support |
Feedback: AutoScrub Property - Leadtools.Multimedia |
Introduction |
Help Version 19.0.2017.6.16
|
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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.