|
Video preview in 4 lines of code:
Let’s start
Microsoft Visual Basic 6.0. Create a new empty project, of the
“Standard EXE” variety:

This should produce a new empty
project, with a single form (empty as well). Now, right-click on
the Components bar and select “Components…”:
 
This will bring up the
components selection dialog of VB.
In the “Controls” tab, select
the “FireiX 1.0 Type Library” and click on OK:
This will add the Fire-iX
FireiPreviewCtrl object selector, which can be used for video
display:


Click on the “ub” tool, and create a
window for video display on the empty form:

Now it's time to edit the form code. First, we need two
global variables, so we add them at the very top:
Dim Manager As FireiManager Dim Camera As
FireiCamera
Then, we create the Manager object, and use it to create
the Camera object (in Form_Load):
Set Manager = new FireiManager Set Camera =
Manager.GetCameraFromIndex(0)
Lastly, we attach the Camera object to our
control, and start it:
FireiPreviewCtrl1.AttachCamera Camera
Camera.Run
That's all, video preview made-easy!
|