![]() |
Video Preview Example |
|
|
WHAT DOES THIS EXAMPLE DO? |
| This example shows you how to display live video in your application. It is done by using the so-called Preview Mode, which is a feature of your video hardware (framgrabber or USB camera). To see how to capture images (meaning to transfer them to your computer's memory) please click here | |
|
|
HOW DOES IT WORK? |
| In part (1), an implementation is shown that will initialize the VideoOCX control and start live video. How to stop the live video again is shown in part (2). | |
|
|
VISUAL BASIC (see below for C++) |
| 1 | ' This sub is called when a ' Start - button is pressed Private Sub Start_Click() ' You might want to select another driver... ' VideoOCX.Driver = 0 ' Init Control VideoOCX.Init ' Set Preview Mode (live video starts now) VideoOCX.SetPreview True End Sub |
| 2 |
' This sub is called when a ' Stop - button is pressed Private Sub Stop_Click() ' Close Control (live video stops) VideoOCX.Close End Sub |
|
|
C++ |
| 1 |
// This procedure is called when // a Start-button is pressed void CYourAppDlg::OnStart() { // You might want to select another driver... // m_VideoOCX.SetDriver(0); // Init Control m_VideoOCX.Init(); // Set Preview Mode (live video starts now) m_VideoOCX.SetPreview(TRUE); } |
| 2 |
// This procedure is called when // a Stop-button is pressed void CYourAppDlg::OnStop() { // Close Control (live video stops) m_VideoOCX.Close(); } |
|
|
WHAT ELSE DO I NEED? |
|
Nothing. The commands shown above are everything that you will need. |