Saves a snapshot from the running stream to a file as a Device Independent Bitmap (DIB).
fileName
A string that represents the name to use when saving the snapshot.
timeOut
The timeout period, in milliseconds. This method will fail if it was not able to take a DIB in the specified time. Use -1 to wait indefinitely until a DIB is snapped.
Saves a snapshot from the running stream to a file. The file is saved as a DIB using the specified filename and timeout period. This method blocks (does not return) until the timeout occurs or the DIB is snapped.
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public PlayCtrlForm _form = new PlayCtrlForm();public PlayCtrl _playctrl = null;public bool _result = false;string _inFile = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_Source.avi");string _outFile = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_SaveStillDIB.dib");public void SaveStillDIBExample(){// reference the play control_playctrl = _form.PlayCtrl;try{// set a timer on the form to make the still DIB_form.TestTimer.Interval = 5000;_form.TestTimer.Tick += new EventHandler(SaveStillDIB_Helper);// set the source and target files_playctrl.SourceFile = _inFile;// now start the test timer for the still DIB capture_form.TestTimer.Start();}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();}public void SaveStillDIB_Helper(object sender, EventArgs e){// cancel the timer_form.TestTimer.Stop();// save the still DIB to a file_playctrl.SaveStillDIB(_outFile, -1);// check for the capture file and set the resultif (File.Exists(Path.Combine(Directory.GetCurrentDirectory(), _outFile)))_result = true;// stop playback_playctrl.Stop();}static class LEAD_VARS{public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 19\Media";}
Imports LeadtoolsImports Leadtools.MultimediaImports LeadtoolsMultimediaExamples.FixturesPublic _form As PlayCtrlForm = New PlayCtrlForm()Public _playctrl As PlayCtrl = NothingPublic _result As Boolean = FalsePrivate _inFile As String = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_Source.avi")Private _outFile As String = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_SaveStillDIB.dib")Public Sub SaveStillDIBExample()' reference the play control_playctrl = _form.PlayCtrlTry' set a timer on the form to make the still DIB_form.TestTimer.Interval = 5000AddHandler _form.TestTimer.Tick, AddressOf SaveStillDIB_Helper' set the source and target files_playctrl.SourceFile = _inFile' now start the test timer for the still DIB capture_form.TestTimer.Start()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 Sub SaveStillDIB_Helper(ByVal sender As Object, ByVal e As EventArgs)' cancel the timer_form.TestTimer.Stop()' save the still DIB to a file_playctrl.SaveStillDIB(_outFile, -1)' check for the capture file and set the resultIf File.Exists(Path.Combine(Directory.GetCurrentDirectory(), _outFile)) Then_result = TrueEnd If' stop playback_playctrl.Stop()End SubPublic NotInheritable Class LEAD_VARSPublic Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 19\Media"End Class
using Leadtools;using Leadtools.Multimedia;using LeadtoolsMultimediaExamples.Fixtures;public PlayCtrlForm _form = new PlayCtrlForm();public PlayCtrl _playctrl = null;public bool _result = false;string _inFile = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_Source.avi");string _outFile = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_SaveStillDIB.dib");public void SaveStillDIBExample(){// reference the play control_playctrl = _form.PlayCtrl;try{// set a timer on the form to make the still DIB_form.TestTimer.Interval = 5000;_form.TestTimer.Tick += new EventHandler(SaveStillDIB_Helper);// set the source and target files_playctrl.SourceFile = _inFile;// now start the test timer for the still DIB capture_form.TestTimer.Start();}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();}public void SaveStillDIB_Helper(object sender, EventArgs e){// cancel the timer_form.TestTimer.Stop();// save the still DIB to a file_playctrl.SaveStillDIB(_outFile, -1);// check for the capture file and set the resultif (File.Exists(Path.Combine(Directory.GetCurrentDirectory(), _outFile)))_result = true;// stop playback_playctrl.Stop();}static class LEAD_VARS{public const string MediaDir = @"C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 19\Media";}
Imports LeadtoolsImports Leadtools.MultimediaImports LeadtoolsMultimediaExamples.FixturesPublic _form As PlayCtrlForm = New PlayCtrlForm()Public _playctrl As PlayCtrl = NothingPublic _result As Boolean = FalsePrivate _inFile As String = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_Source.avi")Private _outFile As String = Path.Combine(LEAD_VARS.MediaDir, "PlayCtrl_SaveStillDIB.dib")Public Sub SaveStillDIBExample()' reference the play control_playctrl = _form.PlayCtrlTry' set a timer on the form to make the still DIB_form.TestTimer.Interval = 5000AddHandler _form.TestTimer.Tick, AddressOf SaveStillDIB_Helper' set the source and target files_playctrl.SourceFile = _inFile' now start the test timer for the still DIB capture_form.TestTimer.Start()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 Sub SaveStillDIB_Helper(ByVal sender As Object, ByVal e As EventArgs)' cancel the timer_form.TestTimer.Stop()' save the still DIB to a file_playctrl.SaveStillDIB(_outFile, -1)' check for the capture file and set the resultIf File.Exists(Path.Combine(Directory.GetCurrentDirectory(), _outFile)) Then_result = TrueEnd If' stop playback_playctrl.Stop()End SubPublic NotInheritable Class LEAD_VARSPublic Const MediaDir As String = "C:\Program Files (x86)\LEAD Technologies\LEADTOOLS 19\Media"End Class
|
Products |
Support |
Feedback: SaveStillDIB Method (PlayCtrl) - 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.