Determines whether there is an available video preview.
public bool IsVideoPreviewAvailable()Public Function IsVideoPreviewAvailable() As Booleanpublic:bool IsVideoPreviewAvailable();
true if the video preview is started; otherwise, false.
This function is used to determine whether the video preview has started. Start the video preview by calling the WiaSession.StartVideoPreview method.
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.Wia<TestMethod()> _#If Not LEADTOOLS_V19_OR_LATER ThenPublic Sub IsVideoPreviewAvailableExample(ByVal parent As IWin32Window)#ElsePublic Sub IsVideoPreviewAvailableExample(ByVal parent As IntPtr)#End If ' #If LEADTOOLS_V19_OR_LATER ThenIf (Not wiaSession.IsAvailable(WiaVersion.Version1)) ThenMessageBox.Show("WIA version 1.0 not installed.")ReturnEnd IfDim session As WiaSession = New WiaSession()session.Startup(WiaVersion.Version1)Dim res As DialogResult = session.SelectDeviceDlg(parent, WiaDeviceType.StreamingVideo, WiaSelectSourceFlags.NoDefault)If res <> DialogResult.OK ThenMessageBox.Show("Error selecting WIA device.")session.Shutdown()ReturnEnd If' start the video previewwiaSession.StartVideoPreview(parent, False)' determine whether a video preview is availableDim available As Boolean = wiaSession.IsVideoPreviewAvailable()If (Not available) ThenMessageBox.Show("No streaming video available.")wiaSession.EndVideoPreview()wiaSession.Shutdown()ReturnEnd If'Resize the video preview area to fit the parent window.'I am calling this resize function here only for demonstration purposes, but you'should call it in your window resize event.wiaSession.ResizeVideoPreview(True)' acquire an image from the video source.Dim takenPictureFileName As String = wiaSession.AcquireImageFromVideo()Dim strMsg As String = String.Format("Acquired image was saved to the following path:\n{0}", takenPictureFileName)MessageBox.Show(strMsg)wiaSession.EndVideoPreview()session.Shutdown()End Sub
using Leadtools;using Leadtools.Codecs;using Leadtools.Wia;[TestMethod]#if !LEADTOOLS_V19_OR_LATERpublic void IsVideoPreviewAvailableExample(IWin32Window parent)#elsepublic void IsVideoPreviewAvailableExample(IntPtr parent)#endif // #if !LEADTOOLS_V19_OR_LATER{if (!WiaSession.IsAvailable(WiaVersion.Version1)){MessageBox.Show("WIA version 1.0 not installed.");return;}WiaSession wiaSession = new WiaSession();wiaSession.Startup(WiaVersion.Version1);DialogResult res = wiaSession.SelectDeviceDlg(parent, WiaDeviceType.StreamingVideo, WiaSelectSourceFlags.NoDefault);if (res != DialogResult.OK){MessageBox.Show("Error selecting WIA device.");wiaSession.Shutdown();return;}// start the video previewwiaSession.StartVideoPreview(parent, false);// determine whether a video preview is availablebool available = wiaSession.IsVideoPreviewAvailable();if(!available){MessageBox.Show("No streaming video available.");wiaSession.EndVideoPreview();wiaSession.Shutdown();return;}// Resize the video preview area to fit the parent window.// I am calling this resize function here only for demonstration purposes, but you// should call it in your window resize event.wiaSession.ResizeVideoPreview(true);// acquire an image from the video source.string takenPictureFileName = wiaSession.AcquireImageFromVideo();string strMsg = String.Format("Acquired image was saved to the following path:\n{0}", takenPictureFileName);MessageBox.Show(strMsg);wiaSession.EndVideoPreview();wiaSession.Shutdown();}
|
Products |
Support |
Feedback: IsVideoPreviewAvailable Method - Leadtools.Wia |
Introduction |
Help Version 19.0.2017.3.21
|

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.